Part Number Hot Search : 
T1310 2SC5335 33660 AD605BRZ RT8011 2SC929 RT8011 TCD1205D
Product Description
Full Text Search
 

To Download MC68HC05C9A Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  mc68hc05 c 9 a /d rev 5 mc68hc05 c 9 a m 6 8 h c 0 5 m 6 0 5m68hc05 m 8 h c 0 5 m 6 8 h c mc68hc l 05 c 9 a mc68h s c05 c 9 a ad va nc e in fo rma tion hcmos m i c r o c o n t r o l l e r u n i t
blank
MC68HC05C9A ? rev. 5.0 advance information motorola 3 MC68HC05C9A mc68hcl05c9a mc68hsc05c9a advance information motorola reserves the right to make changes without further notice to any products herein. motorola makes no warranty, representation or guarantee regarding the suitability of its products for any particular purpose, nor does motorola assume any liability arising out of the application or use of any product or circuit, and specifically disclaims any and all liability, including without limitation consequential or incidental damages. "typical" parameters which may be provided in motorola data sheets and/or specifications can and do vary in different applications and actual performance may vary over time. all operating parameters, including "typicals" must be validated for each customer application by customer?s technical experts. motorola does not convey any license under its patent rights nor the rights of others. motorola products are not designed, intended, or authorized for use as components in systems intended for surgical implant into the body, or other applications intended to support or sustain life, or for any other application in which the failure of the motorola product could create a situation where personal injury or death may occur. should buyer purchase or use motorola products for any such unintended or unauthorized application, buyer shall indemnify and hold motorola and its officers, employees, subsidiaries, affiliates, and distributors harmless against all claims, costs, damages, and expenses, and reasonable attorney fees arising out of, directly or indirectly, any claim of personal injury or death associated with such unintended or unauthorized use, even if such claim alleges that motorola was negligent regarding the design or manufacture of the part. motorola, inc. is an equal opportunity/affirmative action employer. motorola and are registered trademarks of motorola, inc. digitaldna is a trademark of motorola, inc. ? motorola, inc., 1997, 2000
advance information MC68HC05C9A ? rev. 5.0 4 motorola advance information
MC68HC05C9A ? rev. 5.0 advance information motorola list of sections 5 non-disclosure agreement required advance information ? MC68HC05C9A list of sections section 1. general description . . . . . . . . . . . . . . . . . . . . 19 section 2. memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 section 3. central processor unit (cpu) . . . . . . . . . . . . 37 section 4. interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 section 5. resets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 section 6. low-power modes. . . . . . . . . . . . . . . . . . . . . . 55 section 7. input/output ports . . . . . . . . . . . . . . . . . . . . . 57 section 8. capture/compare timer . . . . . . . . . . . . . . . . . 61 section 9. serial communications interface (sci) . . . . . 73 section 10. serial peripheral interface (spi). . . . . . . . . . 91 section 11. instruction set . . . . . . . . . . . . . . . . . . . . . . . 103 section 12. electrical specifications . . . . . . . . . . . . . . . 121 section 13. mechanical specifications . . . . . . . . . . . . . 137 section 14. ordering information . . . . . . . . . . . . . . . . . 141 appendix a. mc68hcl05c9a . . . . . . . . . . . . . . . . . . . . 143 appendix b. mc68hsc05c9a . . . . . . . . . . . . . . . . . . . . 147 appendix c. self-check mode . . . . . . . . . . . . . . . . . . . . 155 appendix d. m68hc05cx family feature comparisons . . . . . . . . . . . . . 159
non-disclosure agreement required list of sections advance information MC68HC05C9A ? rev. 5.0 6 list of sections motorola
MC68HC05C9A ? rev. 5.0 advance information motorola table of contents 7 non-disclosure agreement required advance information ? MC68HC05C9A table of contents section 1. general description 1.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19 1.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19 1.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .20 1.4 mask options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .20 1.5 software-programmable options . . . . . . . . . . . . . . . . . . . . . . .22 1.6 functional pin descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 1.6.1 v dd and v ss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 1.6.2 irq . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 1.6.3 osc1 and osc2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27 1.6.4 reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 1.6.5 tcap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 1.6.6 tcmp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27 1.6.7 pa0 ? pa7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 1.6.8 pb0 ? pb7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 1.6.9 pc0 ? pc7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 1.6.10 pd0 ? pd5 and pd7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .28 section 2. memory 2.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .29 2.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .29 2.3 ram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 2.4 rom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 2.5 rom security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .31 2.6 i/o registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
non-disclosure agreement required table of contents advance information MC68HC05C9A ? rev. 5.0 8 table of contents motorola section 3. central processor unit (cpu) 3.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .37 3.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .37 3.3 cpu registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 3.3.1 accumulator (a) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .39 3.3.2 index register (x) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .39 3.3.3 program counter (pc) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .39 3.3.4 stack pointer (sp) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .39 3.3.5 condition code register (ccr) . . . . . . . . . . . . . . . . . . . . . . 40 section 4. interrupts 4.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .41 4.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .41 4.3 non-maskable software interrupt (swi). . . . . . . . . . . . . . . . . .42 4.4 external interrupt (irq or port b) . . . . . . . . . . . . . . . . . . . . . . .42 4.5 timer interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .44 4.6 sci interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .44 4.7 spi interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .44 section 5. resets 5.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .47 5.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .47 5.3 power-on reset (por) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .48 5.4 reset pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 5.5 computer operating properly (cop) reset . . . . . . . . . . . . . . .50 5.5.1 cop reset register. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 5.5.2 cop control register. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 5.6 cop during wait mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .54 5.7 cop during stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .54 5.8 clock monitor reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
table of contents MC68HC05C9A ? rev. 5.0 advance information motorola table of contents 9 non-disclosure agreement required section 6. low-power modes 6.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55 6.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55 6.3 stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55 6.4 wait mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .56 section 7. input/output ports 7.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .57 7.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .57 7.3 port a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .57 7.4 port b . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .58 7.5 port c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .59 7.6 port d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .59 section 8. capture/compare timer 8.1 content . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61 8.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61 8.3 timer operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .62 8.3.1 input capture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .63 8.3.2 output compare . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .63 8.4 timer i/o registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .64 8.4.1 timer control register . . . . . . . . . . . . . . . . . . . . . . . . . . . . .64 8.4.2 timer status register. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .66 8.4.3 timer registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .67 8.4.4 alternate timer registers. . . . . . . . . . . . . . . . . . . . . . . . . . .68 8.4.5 input capture registers . . . . . . . . . . . . . . . . . . . . . . . . . . . .69 8.4.6 output compare registers. . . . . . . . . . . . . . . . . . . . . . . . . .70 8.5 timer during wait mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .71 8.6 timer during stop mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .71 section 9. serial communications interface (sci) 9.1 content . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .73 9.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .74
non-disclosure agreement required table of contents advance information MC68HC05C9A ? rev. 5.0 10 table of contents motorola 9.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .74 9.4 sci receiver features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 9.5 sci transmitter features . . . . . . . . . . . . . . . . . . . . . . . . . . . . .76 9.6 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 9.7 data format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .78 9.8 receiver wakeup operation. . . . . . . . . . . . . . . . . . . . . . . . . . .78 9.8.1 idle line wakeup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .79 9.8.2 address mark wakeup . . . . . . . . . . . . . . . . . . . . . . . . . . . . .79 9.9 receive data in (rdi). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 9.10 start bit detection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .81 9.11 transmit data out (tdo) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .82 9.12 sci i/o registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 9.12.1 sci data register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .83 9.12.2 sci control register 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . .83 9.12.3 sci control register 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . .84 9.12.4 sci status register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 9.12.5 baud rate register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .89 section 10. serial peripheral interface (spi) 10.1 content . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .91 10.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .91 10.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .92 10.4 spi signal description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 10.4.1 master in/slave out (miso) . . . . . . . . . . . . . . . . . . . . . . . . .93 10.4.2 master out/slave in (mosi) . . . . . . . . . . . . . . . . . . . . . . . . .93 10.4.3 serial clock (sck) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 10.4.4 slave select (ss) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .94 10.5 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 10.6 spi registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .97 10.6.1 serial peripheral control register . . . . . . . . . . . . . . . . . . . .97 10.6.2 serial peripheral status register . . . . . . . . . . . . . . . . . . . . .99 10.6.3 serial peripheral data i/o register . . . . . . . . . . . . . . . . . .101
table of contents MC68HC05C9A ? rev. 5.0 advance information motorola table of contents 11 non-disclosure agreement required section 11. instruction set 11.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .103 11.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .103 11.3 addressing modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .104 11.3.1 inherent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .104 11.3.2 immediate. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .104 11.3.3 direct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .105 11.3.4 extended . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .105 11.3.5 indexed, no offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .105 11.3.6 indexed, 8-bit offset. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .105 11.3.7 indexed, 16-bit offset. . . . . . . . . . . . . . . . . . . . . . . . . . . . .106 11.3.8 relative . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 11.4 instruction types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .107 11.4.1 register/memory instructions. . . . . . . . . . . . . . . . . . . . . . .107 11.4.2 read-modify-write instructions . . . . . . . . . . . . . . . . . . . . .108 11.4.3 jump/branch instructions. . . . . . . . . . . . . . . . . . . . . . . . . .109 11.4.4 bit manipulation instructions . . . . . . . . . . . . . . . . . . . . . . .111 11.4.5 control instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .111 11.5 instruction set summary . . . . . . . . . . . . . . . . . . . . . . . . . . . .112 11.6 opcode map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .118 section 12. electrical specifications 12.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .121 12.2 maximum ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .122 12.3 operating temperature . . . . . . . . . . . . . . . . . . . . . . . . . . . . .123 12.4 thermal characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . .123 12.5 power considerations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .124 12.6 5.0-volt dc electrical characteristics. . . . . . . . . . . . . . . . . . .125 12.7 3.3-volt dc electrical characteristics. . . . . . . . . . . . . . . . . . .126 12.8 5.0-volt control timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .128 12.9 3.3-volt control timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .129 12.10 5.0-volt serial peripheral interface timing . . . . . . . . . . . . . . .132 12.11 3.3-volt serial peripheral interface timing . . . . . . . . . . . . . . .133
non-disclosure agreement required table of contents advance information MC68HC05C9A ? rev. 5.0 12 table of contents motorola section 13. mechanical specifications 13.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .137 13.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .137 13.3 40-pin plastic dual in-line (dip) package (case 711-03) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .138 13.4 42-pin plastic shrink dual in-line (sdip) package (case 858-01) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .138 13.5 44-lead plastic-leaded chip carrier (plcc) (case 777-02) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .139 13.6 44-lead quad flat pack (qfp) (case 824a-01) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .140 section 14. ordering information 14.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .141 14.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .141 14.3 mc order numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .141 appendix a. mc68hcl05c9a a.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .143 a.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .143 a.3 operating temperature . . . . . . . . . . . . . . . . . . . . . . . . . . . . .143 a.4 dc electrical characeristics . . . . . . . . . . . . . . . . . . . . . . . . . . 144 a.4.1 1.8 ? 2.4-volt low-power output voltage . . . . . . . . . . . . . .144 a.4.2 1.8 ? 2.4-volt input pullup current . . . . . . . . . . . . . . . . . . . .144 a.4.3 2.5 ? 3.6-volt low-power output voltage . . . . . . . . . . . . . .145 a.4.4 2.6 ? 3.6-volt input pullup current . . . . . . . . . . . . . . . . . . . .145 a.4.5 low-power supply current . . . . . . . . . . . . . . . . . . . . . . . .146 appendix b. mc68hsc05c9a b.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .147 b.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .147 b.3 operating temperature . . . . . . . . . . . . . . . . . . . . . . . . . . . . .148
table of contents MC68HC05C9A ? rev. 5.0 advance information motorola table of contents 13 non-disclosure agreement required b.4 dc electrical characeristics . . . . . . . . . . . . . . . . . . . . . . . . . . 149 b.4.1 high-speed supply current . . . . . . . . . . . . . . . . . . . . . . . .149 b.4.2 input pullup current . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .149 b.5 control timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .150 b.5.1 4.5 ? 5.5-volt high-speed control timing . . . . . . . . . . . . . .150 b.5.2 2.4 ? 3.6-volt high-speed control timing . . . . . . . . . . . . . .151 b.5.3 4.5 ? 5.5-volt high-speed control timing . . . . . . . . . . . . . .152 b.5.4 2.4 ? 3.6-volt high-speed spi timing . . . . . . . . . . . . . . . . .153 appendix c. self-check mode c.1 contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .155 c.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .155 c.3 self-check mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .156 c.3.1 self-check tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .156 c.3.2 self-check results. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158 appendix d. m68hc05cx family feature comparisons
non-disclosure agreement required table of contents advance information MC68HC05C9A ? rev. 5.0 14 table of contents motorola
MC68HC05C9A ? rev. 5.0 advance information motorola list of figures 15 non-disclosure agreement required advance information ? MC68HC05C9A list of figures figure title page 1-1 block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 1-2 option register. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 1-3 40-pin pdip pin assignments . . . . . . . . . . . . . . . . . . . . . . . . .23 1-4 42-pin sdip pin assignments . . . . . . . . . . . . . . . . . . . . . . . . .24 1-5 44-lead plcc pin assignments . . . . . . . . . . . . . . . . . . . . . . .25 1-6 44-pin qfp pin assignments . . . . . . . . . . . . . . . . . . . . . . . . . .26 2-1 memory map. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .30 2-2 i/o register summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .32 2-3 input/output registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .33 3-1 programming model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .38 3-2 interrupt stacking order . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .38 4-1 interrupt flowchart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .45 5-1 reset sources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .48 5-2 power-on reset and reset . . . . . . . . . . . . . . . . . . . . . . . . . . 49 5-3 cop block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .50 5-4 cop reset register (coprst). . . . . . . . . . . . . . . . . . . . . . . .51 5-5 cop control register (copcr). . . . . . . . . . . . . . . . . . . . . . . .52 6-1 stop recovery timing diagram . . . . . . . . . . . . . . . . . . . . . . . .56 7-1 port a i/o circuit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 7-2 port b i/o logic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .60 8-1 capture/compare timer block diagram. . . . . . . . . . . . . . . . . .62 8-2 timer control register (tcr). . . . . . . . . . . . . . . . . . . . . . . . . .64 8-3 timer status register (tsr) . . . . . . . . . . . . . . . . . . . . . . . . . .66 8-4 timer registers (trh and trl). . . . . . . . . . . . . . . . . . . . . . . .67 8-5 alternate timer registers (atrh and atrl). . . . . . . . . . . . . .68 8-6 input capture registers (icrh and icrl) . . . . . . . . . . . . . . . . 69 8-7 output compare registers (ocrh and ocrl) . . . . . . . . . . . . 70
non-disclosure agreement required list of figures advance information MC68HC05C9A ? rev. 5.0 16 list of figures motorola figure title page 9-1 serial communications interface block diagram . . . . . . . . . . .75 9-2 rate generator division . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 9-3 data format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .78 9-4 sci examples of start bit sampling techniques . . . . . . . . . . .80 9-5 sci sampling technique used on all bits . . . . . . . . . . . . . . . .80 9-6 sci artificial start following a frame error . . . . . . . . . . . . . . . 81 9-7 sci start bit following a break . . . . . . . . . . . . . . . . . . . . . . . .82 9-8 sci data register (scdr) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 9-9 sci control register 1 (sccr1) . . . . . . . . . . . . . . . . . . . . . . . 83 9-10 sci control register 2 (sccr2) . . . . . . . . . . . . . . . . . . . . . . . 85 9-11 sci status register (scsr). . . . . . . . . . . . . . . . . . . . . . . . . . . 87 9-12 baud rate register (baud) . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 10-1 data clock timing diagram . . . . . . . . . . . . . . . . . . . . . . . . . . .93 10-2 serial peripheral interface block diagram . . . . . . . . . . . . . . . .95 10-3 serial peripheral interface master-slave interconnection . . . .96 10-4 spi control register (spcr) . . . . . . . . . . . . . . . . . . . . . . . . . .97 10-5 spi status register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .99 10-6 spi data register (spdr) . . . . . . . . . . . . . . . . . . . . . . . . . . .101 12-1 test load . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .123 12-2 maximum supply current versus internal clock frequency, v dd = 5.5 v. . . . . . . . . . . . . . . . . . . . . .127 12-3 maximum supply current versus internal clock frequency, v dd = 3.6 v. . . . . . . . . . . . . . . . . . . . . .127 12-4 tcap timing relationships . . . . . . . . . . . . . . . . . . . . . . . . . .129 12-5 external interrupt timing . . . . . . . . . . . . . . . . . . . . . . . . . . . .130 12-6 stop recovery timing diagram . . . . . . . . . . . . . . . . . . . . . . .130 12-7 power-on reset timing diagram. . . . . . . . . . . . . . . . . . . . . .131 12-8 external reset timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .131 12-9 spi master timing diagram . . . . . . . . . . . . . . . . . . . . . . . . . .134 12-10 spi slave timing diagram . . . . . . . . . . . . . . . . . . . . . . . . . . .135 13-1 40-pin plastic dip package (case 711-03) . . . . . . . . . . . . . .138 13-2 42-pin plastic sdip package (case 858-01) . . . . . . . . . . . . .138 13-3 44-lead plcc (case 777-02) . . . . . . . . . . . . . . . . . . . . . . . .139 13-4 44-lead qfp (case 824a-01) . . . . . . . . . . . . . . . . . . . . . . . .140 c-1 self-check circuit schematic . . . . . . . . . . . . . . . . . . . . . . . . . 157
MC68HC05C9A ? rev. 5.0 advance information motorola list of tables 17 non-disclosure agreement required advance information ? MC68HC05C9A list of tables table title page 4-1 vector addresses for interrupts and resets. . . . . . . . . . . . . . .43 5-1 cop timeout period. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .53 9-1 baud rate generator clock prescaling . . . . . . . . . . . . . . . . . .89 9-2 baud rate selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .90 10-1 spi clock rate selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 11-1 register/memory instructions . . . . . . . . . . . . . . . . . . . . . . . . .107 11-2 read-modify-write instructions . . . . . . . . . . . . . . . . . . . . . . .108 11-3 jump and branch instructions . . . . . . . . . . . . . . . . . . . . . . . .110 11-4 bit manipulation instructions. . . . . . . . . . . . . . . . . . . . . . . . . .111 11-5 control instructions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .111 11-6 instruction set summary . . . . . . . . . . . . . . . . . . . . . . . . . . . .112 11-7 opcode map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .119 14-1 mc order numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .141 b-1 high-speed operating temperature range. . . . . . . . . . . . . .148 c-1 self-check circuit led codes . . . . . . . . . . . . . . . . . . . . . . . . 158 d-1 m68hc05cx feature comparison . . . . . . . . . . . . . . . . . . . . .160
non-disclosure agreement required list of tables advance information MC68HC05C9A ? rev. 5.0 18 list of tables motorola
MC68HC05C9A ? rev. 5.0 advance information motorola general description 19 non-disclosure agreement required advance information ? MC68HC05C9A section 1. general description 1.1 contents 1.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19 1.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .20 1.4 mask options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .20 1.5 software-programmable options . . . . . . . . . . . . . . . . . . . . . . .22 1.6 functional pin descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 1.6.1 v dd and v ss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 1.6.2 irq . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 1.6.3 osc1 and osc2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27 1.6.4 reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 1.6.5 tcap. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 1.6.6 tcmp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27 1.6.7 pa0 ? pa7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 1.6.8 pb0 ? pb7. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 1.6.9 pc0 ? pc7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .28 1.6.10 pd0 ? pd5 and pd7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .28 1.2 introduction the MC68HC05C9A hcmos (high-density complementary metal-oxide semiconductor) microcontroller is a member of the m68hc05 family. the MC68HC05C9A memory map consists of 15,936 bytes of user rom and 352 bytes of ram. the MC68HC05C9A includes a serial communications interface, a serial peripheral interface, and a 16-bit capture/compare timer.
non-disclosure agreement required general description advance information MC68HC05C9A ? rev. 5.0 20 general description motorola 1.3 features features of the MC68HC05C9A include:  m68hc05 cpu  mask programmable interrupt capability on port b  software programmable external interrupt sensitivity  15,936 bytes of read-only memory (rom)  352 bytes of random-access memory (ram)  memory mapped input/output (i/o)  31 bidirectional i/o lines with high current sink and source on pc7  asynchronous serial communications interface (sci)  synchronous serial peripheral interface (spi)  16-bit capture/compare timer  computer operating properly (cop) watchdog timer and clock monitor  power-saving wait and stop modes  on-chip crystal oscillator connections  single 3.0 volts to 5.5 volts power supply requirement  rom contents security (1) feature  available packages: ? 40-pin dual in-line (dip) ? 44-pin plastic leaded chip carrier (plcc) ? 44-pin quad flat pack (qfp) ? 42-pin plastic shrink dual in-line (sdip) packages 1.4 mask options eight mask options are available to select external interrupt capability (including an internal pullup device) on each of the port b pins. 1. no security feature is absolutely secure. however, motorola ? s strategy is to make reading or copying the rom difficult for unauthorized users.
general description mask options MC68HC05C9A ? rev. 5.0 advance information motorola general description 21 non-disclosure agreement required figure 1-1. block diagram 0 0000011 cpu control arithmetic logic unit accumulator index register stack pointer program counter m68hc05 mcu reset condition code register 111hi ncz data direction register a port a pa7 pa6 pa5 pa4 pa3 pa2 pa1 pa0 cop internal oscillator divide by two capture/ irq v dd v ss osc1 osc2 user ram ? 352 bytes reset data direction register b port b pb7 pb6 pb5 pb4 pb3 pb2 pb1 pb0 data direction register c port c user rom ? 15,936 bytes pc7 pc6 pc5 pc4 pc3 pc2 pc1 pc0 compare timer tcmp tcap watchdog cpu clock power internal clock spi generator baud rate sci ss sck mosi miso tdo rdi data direction register d port d pd7 pd5/ss pd4/sck pd3/mosi pd2/miso pd1/tdo pd0/rdi divide by four timer clock self-check rom ? 239 bytes
non-disclosure agreement required general description advance information MC68HC05C9A ? rev. 5.0 22 general description motorola 1.5 software-programmable options the option register (or), shown in figure 1-2 , contains the programmable bits for these options:  map two different areas of memory between ram and rom, one of 48 bytes and one of 128 bytes  edge-triggered only or edge- and level-triggered external interrupt (irq pin and any port b pin configured for interrupt) this register must be written to by user software during operation of the microcontroller. ram0 ? random-access memory control bit 0 this read/write bit selects between ram or rom in location $0020 to $004f. this bit can be read or written at any time. 1 = ram selected 0 = rom selected ram1 ? random-access memory control bit 1 this read/write bit selects between ram or rom in location $0100 to $017f. this bit can be read or written at any time. 1 = ram selected 0 = eprom selected irq ? interrupt request bit this bit selects between an edge-triggered only or edge- and level- triggered external interrupt. this bit is set by reset, but can be cleared by software. this bit can be written only once. 1 = edge and level interrupt option selected 0 = edge-only interrupt option selected address: $3fdf bit 7654321bit 0 read: ram0 ram1 0000 irq 0 write: reset:00000010 = unimplemented figure 1-2. option register
general description functional pin descriptions MC68HC05C9A ? rev. 5.0 advance information motorola general description 23 non-disclosure agreement required 1.6 functional pin descriptions figure 1-3 , figure 1-4 , figure 1-5 , and figure 1-6 show the pin assignments for the available packages. a functional description of the pins follows. note: a line over a signal name indicates an active low signal. for example, reset is active high and reset is active low. figure 1-3. 40-pin pdip pin assignments note: if mc68hc705c9a devices are to be used in the same socket, pin 3 should be tied to v dd . 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 pc7 pc6 pc5 pc4 pc3 pc2 pc1 pc0 pd0/rdi pd1/tdo pd2/miso pd3/mosi pd4/sck pd5/ss tcmp pd7 tcap osc2 osc1 v dd v ss pb7 pb6 pb5 pb4 pb3 pb2 pb1 pb0 pa0 pa1 pa2 pa3 pa4 pa5 pa6 pa7 n/c irq reset
non-disclosure agreement required general description advance information MC68HC05C9A ? rev. 5.0 24 general description motorola figure 1-4. 42-pin sdip pin assignments note: if mc68hc705c9a devices are to be used in the same socket, pin 3 should be tied to v dd . 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 pc6 pc5 pc4 pc3 n/c pc2 pc1 pc0 pd0/rdi pd1/tdo pd2/miso pd3/mosi pd4/sck pd5/ss tcmp pd7 tcap osc2 osc1 v dd pb7 pb6 pb5 pb4 n/c pb3 pb2 pb1 pb0 pa0 pa1 pa2 pa3 pa4 pa5 pa6 pa7 n/c irq reset 21 22 pc7 v ss
general description functional pin descriptions MC68HC05C9A ? rev. 5.0 advance information motorola general description 25 non-disclosure agreement required figure 1-5. 44-lead plcc pin assignments note: the 44-pin plcc pin assignment diagram is for compatibility with the mc68hc705c9a. however, if mc68hc705c9a devices are to be used in the same socket, pin 3 should be tied to v dd . for compatibility with mc68hc05c4a/c8a/c12a devices in 44-pin plcc, tie pins 17 and 18 together, and tie pins 39 and 40 together. for compatibility with mc68hc705c8a 44-pin plcc device, three sets of pins should be tied together: pins 17 and 18, pins 39 and 40, and pins 3, 4, and 44. 39 38 37 36 35 34 33 32 31 30 29 pc2 pc1 pc0 pd0/rdi pd1/tdo pd2miso pd3/mosi pd4/sck pd5/ss tcmp n/c 7 8 9 10 11 12 13 14 15 16 17 28 27 26 25 24 23 22 21 20 19 18 6 5 4 3 2 44 43 42 41 40 1 pd7 pc4 pc5 pc6 pc7 n/c v ss pb7 pb6 pb5 pb4 tcap osc2 osc1 v dd reset irq n/c n/c pa 7 pa 6 pa5 pa4 pa3 pa2 pa1 pa0 pb0 pb1 pb2 pb3 n/c pc3
non-disclosure agreement required general description advance information MC68HC05C9A ? rev. 5.0 26 general description motorola figure 1-6. 44-pin qfp pin assignments note: if mc68hc705c9a devices are to be used in the same socket, pin 43 should be tied to v dd . 1.6.1 v dd and v ss power is supplied to the mcu using these two pins. v dd is the positive supply and v ss is ground. 1.6.2 irq this interrupt pin has an option that provides two different choices of interrupt triggering sensitivity. the irq pin contains an internal schmitt trigger as part of its input to improve noise immunity. refer to section 4. interrupts for more detail. 33 32 31 30 29 28 27 26 25 24 23 pc3 pc2 pc1 pc0 pd0/rdi pd1/tdo pd2/miso pd3/mosi pd4/sck pd5/ss tcmp 1 2 3 4 5 6 7 8 9 10 11 22 21 20 19 18 17 16 15 14 13 12 44 43 42 41 40 38 37 36 35 34 pd7 pc4 pc5 pc6 pc7 v ss n/c pb7 pb6 pb5 pb4 tcap osc2 osc1 v dd n/c n/c reset irq n/c pa7 pa 6 pa 5 pa 4 pa 3 pa 2 pa 1 pa 0 pb0 pb1 pb2 pb3 39 n/c
general description functional pin descriptions MC68HC05C9A ? rev. 5.0 advance information motorola general description 27 non-disclosure agreement required 1.6.3 osc1 and osc2 these pins provide control input for an on-chip clock oscillator circuit. a crystal or ceramic resonator connected to these pins provides a system clock. the internal frequency is one-half the crystal frequency. 1.6.4 reset as an input pin, this active low reset pin is used to reset the mcu to a known startup state by pulling reset low. as an output pin, the reset pin indicates that an internal mcu reset has occurred. the reset pin contains an internal schmitt trigger as part of its input to improve noise immunity. refer to section 5. resets for more detail. 1.6.5 tcap this pin controls the input capture feature for the on-chip programmable timer. the tcap pin contains an internal schmitt trigger as part of its input to improve noise immunity. refer to section 8. capture/compare timer for more detail. 1.6.6 tcmp the tcmp pin provides an output for the output compare feature of the on-chip programmable timer. refer to section 8. capture/compare timer for more detail. 1.6.7 pa0 ? pa7 these eight i/o lines comprise port a. the state of each pin is software programmable and all port a pins are configured as inputs during reset. refer to section 7. input/output ports for more detail.
non-disclosure agreement required general description advance information MC68HC05C9A ? rev. 5.0 28 general description motorola 1.6.8 pb0 ? pb7 these eight i/o lines comprise port b. the state of each pin is software programmable and all port b pins are configured as inputs during reset. port b has mask option register enabled pullup devices and interrupt capability selectable for any pin. refer to section 7. input/output ports for more detail. 1.6.9 pc0 ? pc7 these eight i/o lines comprise port c. the state of each pin is software programmable and all port c pins are configured as inputs during reset. pc7 has high current sink and source capability. refer to section 7. input/output ports for more detail. 1.6.10 pd0 ? pd5 and pd7 these seven i/o lines comprise port d. the state of each pin is software programmable and all port d pins are configured as inputs during reset. refer to section 7. input/output ports for more detail.
MC68HC05C9A ? rev. 5.0 advance information motorola memory 29 non-disclosure agreement required advance information ? MC68HC05C9A section 2. memory 2.1 contents 2.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .29 2.3 ram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 2.4 rom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 2.5 rom security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .31 2.6 i/o registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 2.2 introduction the microcontroller unit (mcu) has a 16-kbyte memory map. the memory map consists of:  input/output (i/o), control, and status registers  user random-access memory (ram)  user read-only memory (rom)  self-check rom  reset and interrupt vectors see figure 2-1 and figure 2-2 . two control bits in the option register ($3fdf) allow the user to switch between ram and rom at any time in two special areas of the memory map, $0020 ? $004f (48 bytes) and $0100 ? $017f (128 bytes).
non-disclosure agreement required memory advance information MC68HC05C9A ? rev. 5.0 30 memory motorola figure 2-1. memory map port a data register port b data register port c data register port d data register port a data direction register port b data direction register port c data direction register port d data direction register unused unused spi control register spi status register spi data register sci baud rate register sci control register 1 sci control register 2 sci status register sci data register timer control register timer status register input capture register (high) spi vector (high) spi vector (low) sci vector (high) sci vector (low) timer vector (high) timer vector (low) irq vector (high) irq vector (low) swi vector (high) swi vector (low) reset vector (high byte) reset vector (low byte) $0000 $0001 $0002 $0003 $0004 $0005 $0006 $0007 $0008 $0009 $000a $000b $000c $000d $000e $000f $0010 $0012 $0011 $0013 $0019 $001a $001b $001c $3ff4 $3ff3 $3ff5 $3ff6 $3ff7 $3ff8 i/o registers 32 bytes $0000 $001f $0020 $004f $0050 ram 176 bytes $00ff $0100 user rom 15,744 bytes $017f $0180 user rom vectors $3fff 16 bytes $0014 input capture register (low) output compare register (high) output compare register (low) timer counter register (high) $3ff9 $3ffb $3ffa $3ffc $3ffd $3ffe $3fff timer counter register (low) $0015 $0016 $0017 $0018 $001d $001e $001f alternate counter register (high) alternate counter register (low) unused cop reset register cop control register unused $3fef $3eff $3f00 stack 64 bytes ram 48 bytes ram0 = 1 user rom 48 bytes ram0 = 0 ram ram1 = 1 user rom ram1 = 0 128 bytes 128 bytes self-check rom and vectors 239 bytes $00bf $00c0 $3ff0 $3ff0 unused (4 bytes) option register $3fdf
memory ram MC68HC05C9A ? rev. 5.0 advance information motorola memory 31 non-disclosure agreement required 2.3 ram the main user ram consists of 176 bytes at $0050 ? $00ff. this ram area is always present in the memory map and includes a 64-byte stack area. the stack pointer can access 64 bytes of ram in the range $00ff down to $00c0. note: using the stack area for data storage or temporary work locations requires care to prevent it from being overwritten due to stacking from an interrupt or subroutine call. two additional ram areas are available at $0020 ? $004f (48 bytes) and $0100 ? $017f (128 bytes) (see figure 2-1 and figure 2-2 .) these may be accessed at any time by setting the ram0 and ram1 bits, respectively, in the option register. refer to 1.5 software-programmable options for additional information. 2.4 rom the user rom consists of 48 bytes of page zero rom from $0020 to $004f, 15,872 bytes of rom from $0100 to $3eff, and 16 bytes of user vectors from $3ff0 to $3fff. 2.5 rom security a security feature has been incorporated into the MC68HC05C9A to help prevent external access to the contents of the rom in any mode of operation. 2.6 i/o registers except for the option register, all i/o, control and status registers are located within one 32-byte block in page zero of the address space ($0000 ? $001f). a summary of these registers is shown in figure 2-2 . more detail about the contents of these registers is given in figure 2-3 .
non-disclosure agreement required memory advance information MC68HC05C9A ? rev. 5.0 32 memory motorola address register name $0000 port a data register $0001 port b data register $0002 port c data register $0003 port d data register $0004 port a data direction register $0005 port b data direction register $0006 port c data direction register $0007 port d data direction register $0008 unused $0009 unused $000a serial peripheral control register $000b serial peripheral status register $000c serial peripheral data register $000d baud rate register $000e serial communications control register 1 $000f serial communications control register 2 $0010 serial communications status register $0011 serial communications data register $0012 timer control register $0013 timer status register $0014 input capture register high $0015 input capture register low $0016 output compare register high $0017 output compare register low $0018 timer register high $0019 timer register low $001a alternate timer register high $001b alternate timer register low $001c unused $001d cop reset register $001e cop control register $001f reserved figure 2-2. i/o register summary
memory i/o registers MC68HC05C9A ? rev. 5.0 advance information motorola memory 33 non-disclosure agreement required addr. register name bit 7 6 5 4 3 2 1 bit 0 $0000 port a data register (porta) see page 57. read: pa7 pa6 pa5 pa4 pa3 pa2 pa1 pa0 write: reset: unaffected by reset $0001 port b data register (portb) see page 58. read: pb7 pb6 pb5 pb4 pb3 pb2 pb1 pb0 write: reset: unaffected by reset $0002 port c data register (portc) see page 59. read: pc7 pc6 pc5 pc4 pc3 pc2 pc1 pc0 write: reset: unaffected by reset $0003 port d data register (portd) see page 59. read: pd7 pd5 pd4 pd3 pd2 pd1 pd0 write: reset: unaffected by reset $0004 port a data direction register (ddra) see page 57. read: ddra7 ddra6 ddra5 ddra4 ddra3 ddra2 ddra1 ddra0 write: reset: 0 0 0 0 0 0 0 0 $0005 port b data direction register (ddrb) see page 58. read: ddrb7 ddrb6 ddrb5 ddrb4 ddrb3 ddrb2 ddrb1 ddrb0 write: reset: 0 0 0 0 0 0 0 0 $0006 port c data direction register (ddrc) see page 59. read: ddrc7 ddrc6 ddrc5 ddrc4 ddrc3 ddrc2 ddrc1 ddrc0 write: reset: 0 0 0 0 0 0 0 0 $0007 port d data direction register (ddrd) see page 59. read: ddrc7 ddrc5 ddrc4 ddrc3 ddrc2 ddrc1 ddrc0 write: reset: 0 0 0 0 0 0 0 0 $0008 unimplemented = unimplemented r = reserved u = unaffected figure 2-3. input/output registers (sheet 1 of 4)
non-disclosure agreement required memory advance information MC68HC05C9A ? rev. 5.0 34 memory motorola $0009 unimplemented $000a spi control register (spcr) see page 97. read: spie spe dwom mstr cpol cpha spr1 spr0 write: reset: 0 0 0 0 0 1 u u $000b spi status register (spsr) see page 99. read: spif wcol 0 modf 0 0 0 0 write: reset: 0 0 0 0 0 0 0 0 $000c spi data register (spdr) see page 101. read: spd7 spd6 spd5 spd4 spd3 spd2 spd1 spd0 write: reset: unaffected by reset $000d sci baud rate register baud see page 89. read: scp1 scp0 scr2 scr1 scr0 write: reset: ? ? 00 ? uuu $000e sci control register 1 (sccr1) see page 83. read: r8 t8 m wake write: reset:uu0uu000 $000f sci control register 2 (sccr2) see page 85. read: tie tcie rie ilie te re rmw sbk write: reset: 0 0 0 0 0 0 0 0 $0010 sci status register (scsr) see page 87. read: tdre tc rdrf idle or nf fe write: reset: 1 1 0 0 0 0 0 ? $0011 sci data register (scdr) see page 83. read: scd7 sdc6 scd5 scd4 scd3 scd2 scd1 scd0 write: reset: unaffected by reset addr. register name bit 7 6 5 4 3 2 1 bit 0 = unimplemented r = reserved u = unaffected figure 2-3. input/output registers (sheet 2 of 4)
memory i/o registers MC68HC05C9A ? rev. 5.0 advance information motorola memory 35 non-disclosure agreement required $0012 timer control register (tcr) see page 64. read: icie ocie toie 000 iedg olvl write: reset: 0 0 0 0 0 0 u 0 $0013 timer status register (tsr) see page 66. read: icf ocf tof 0 0 0 0 0 write: reset: u u u 0 0 0 0 0 $0014 input capture register high (icrh) see page 69. read: bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 write: reset: unaffected by reset $0015 input capture register low (icrl) see page 69. read: bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 write: reset: unaffected by reset $0016 output compare register high (ocrh) see page 70. read: bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 write: reset: unaffected by reset $0017 output compare register low (ocrl) see page 70. read: bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 write: reset: unaffected by reset $0018 timer register high (trh) see page 67. read: bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 write: reset: 1 1 1 1 1 1 1 1 $0019 timer register low (trl) see page 67. read: bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 write: reset: 1 1 1 1 1 1 0 0 $001a alternate timer register high (atrh) see page 68. read: bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 write: reset: 1 1 1 1 1 1 1 1 addr. register name bit 7 6 5 4 3 2 1 bit 0 = unimplemented r = reserved u = unaffected figure 2-3. input/output registers (sheet 3 of 4)
non-disclosure agreement required memory advance information MC68HC05C9A ? rev. 5.0 36 memory motorola $001b alternate timer register low (atrl) see page 68. read: bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 write: reset: 1 1 1 1 1 1 0 0 $001c unimplemented $001d cop reset register (coprst) see page 51. read: write: bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reset: 0 0 0 0 0 0 0 0 $001e cop control register (copcr) see page 52. read: 0 0 0 copf cme cope cm1 cm0 write: reset: 0 0 0 u 0 0 0 0 $001d unimplemented $001e unimplemented $001f reserved r r r r r r r r addr. register name bit 7 6 5 4 3 2 1 bit 0 = unimplemented r = reserved u = unaffected figure 2-3. input/output registers (sheet 4 of 4)
MC68HC05C9A ? rev. 5.0 advance information motorola central processor unit (cpu) 37 non-disclosure agreement required advance information ? MC68HC05C9A section 3. central processor unit (cpu) 3.1 contents 3.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .37 3.3 cpu registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 3.3.1 accumulator (a). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .39 3.3.2 index register (x) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .39 3.3.3 program counter (pc) . . . . . . . . . . . . . . . . . . . . . . . . . . . .39 3.3.4 stack pointer (sp). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .39 3.3.5 condition code register (ccr) . . . . . . . . . . . . . . . . . . . . . 40 3.2 introduction this section contains information describing the basic programmer ? s model and the registers contained in the central processor unit (cpu).
non-disclosure agreement required central processor unit (cpu) advance information MC68HC05C9A ? rev. 5.0 38 central processor unit (cpu) motorola 3.3 cpu registers the microcontroller unit (mcu) contains five registers as shown in the programming model of figure 3-1 . the interrupt stacking order is shown in figure 3-2 . figure 3-1. programming model figure 3-2. interrupt stacking order a 70 x 70 hinzc ccr 11 sp 7 0 pc 13 0 accumulator index register program counter stack pointer condition code register 0 13 0 0 0 0 0 index register pcl accumulator condition code register pch 111 70 stack i n t e r r u p t decreasing unstack r e t u r n increasing memory addresses memory addresses
central processor unit (cpu) cpu registers MC68HC05C9A ? rev. 5.0 advance information motorola central processor unit (cpu) 39 non-disclosure agreement required 3.3.1 accumulator (a) the accumulator is a general-purpose 8-bit register used to hold operands and results of arithmetic calculations or data manipulations. 3.3.2 index register (x) the index register is an 8-bit register used for the indexed addressing value to create an effective address. the index register may also be used as a temporary storage area. 3.3.3 program counter (pc) the program counter is a 14-bit register that contains the address of the next byte to be fetched. 3.3.4 stack pointer (sp) the stack pointer contains the address of the next free location on the stack. during an mcu reset or the reset stack pointer (rsp) instruction, the stack pointer is set to location $0ff. the stack pointer is then decremented as data is pushed onto the stack and incremented as data is pulled from the stack. when accessing memory, the eight most significant bits are permanently set to 00000011. these eight bits are appended to the six least significant register bits to produce an address within the range of $00ff to $00c0. subroutines and interrupts may use up to 64 (decimal) locations. if 64 locations are exceeded, the stack pointer wraps around and loses the previously stored information. a subroutine call occupies two locations on the stack; an interrupt uses five locations.
non-disclosure agreement required central processor unit (cpu) advance information MC68HC05C9A ? rev. 5.0 40 central processor unit (cpu) motorola 3.3.5 condition code register (ccr) the ccr is a 5-bit register in which four bits are used to indicate the results of the instruction just executed, and the fifth bit indicates whether interrupts are masked. these bits can be individually tested by a program, and specific actions can be taken as a result of their state. each bit is explained here. half carry (h) this bit is set during add and adc operations to indicate that a carry occurred between bits 3 and 4. interrupt (i) when this bit is set, the timer, serial communications interface (sci), serial peripheral interface (spi), and external interrupt are masked (disabled). if an interrupt occurs while this bit is set, the interrupt is latched and processed as soon as the interrupt bit is cleared. negative (n) when set, this bit indicates that the result of the last arithmetic, logical, or data manipulation was negative. zero (z) when set, this bit indicates that the result of the last arithmetic, logical, or data manipulation was 0. carry/borrow (c) when set, this bit indicates that a carry or borrow out of the arithmetic logical unit (alu) occurred during the last arithmetic operation. this bit is also affected during bit test and branch instructions and during shifts and rotates.
MC68HC05C9A ? rev. 5.0 advance information motorola interrupts 41 non-disclosure agreement required advance information ? MC68HC05C9A section 4. interrupts 4.1 contents 4.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .41 4.3 non-maskable software interrupt (swi). . . . . . . . . . . . . . . . . .42 4.4 external interrupt (irq or port b) . . . . . . . . . . . . . . . . . . . . . . .42 4.5 timer interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .44 4.6 sci interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .44 4.7 spi interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .44 4.2 introduction the MC68HC05C9A microcontroller unit (mcu) can be interrupted by five different sources: four maskable hardware interrupts, and one non- maskable software interrupt:  external signal on the irq pin or port b pins  16-bit programmable timer  serial communications interface (sci)  serial peripheral interface (spi)  software interrupt instruction (swi) interrupts cause the processor to save register contents on the stack and to set the interrupt mask (i bit) to prevent additional interrupts. the return from interrupt (rti) instruction causes the register contents to be recovered from the stack and normal processing to resume.
non-disclosure agreement required interrupts advance information MC68HC05C9A ? rev. 5.0 42 interrupts motorola unlike reset, hardware interrupts do not cause the current instruction execution to be halted, but are considered pending until the current instruction is complete. note: the current instruction is the one already fetched and being operated on. when the current instruction is complete, the processor checks all pending hardware interrupts. if interrupts are not masked (ccr i bit clear) and if the corresponding interrupt enable bit is set, the processor proceeds with interrupt processing; otherwise, the next instruction is fetched and executed. if an external interrupt and a timer, sci, or spi interrupt are pending at the end of an instruction execution, the external interrupt is serviced first. the swi is executed the same as any other instruction, regardless of the i-bit state. table 4-1 shows the relative priority of all the possible interrupt sources. figure 4-1 shows the interrupt processing flow. 4.3 non-maskable software interrupt (swi) the swi is an executable instruction and a non-maskable interrupt. it is executed regardless of the state of the i bit in the ccr. if the i bit is 0 (interrupts enabled), swi executes after interrupts which were pending when the swi was fetched, but before interrupts generated after the swi was fetched. the interrupt service routine address is specified by the contents of memory locations $3ffc and $3ffd. 4.4 external interrupt (irq or port b) if the interrupt mask bit (i bit) of the ccr is set, all maskable interrupts (internal and external) are disabled. clearing the i bit enables interrupts. the interrupt request is latched immediately following the falling edge of irq . it is then synchronized internally and serviced as specified by the contents of $3ffa and $3ffb.
interrupts external interrupt (irq or port b) MC68HC05C9A ? rev. 5.0 advance information motorola interrupts 43 non-disclosure agreement required when any of the port b pullups are enabled, each pin becomes an additional external interrupt source which is executed identically to the irq pin. port b interrupts follow the same edge/edge-level selection as the irq pin. the branch instructions bil and bih also respond to the port b interrupts in the same way as the irq pin. see 7.4 port b . either a level-sensitive and edge-sensitive trigger or an edge-sensitive- only trigger operation is selectable. the sensitivity is software-controlled by the irq bit in the option register ($3fdf). note: the internal interrupt latch is cleared in the first part of the interrupt service routine; therefore, one external interrupt pulse can be latched and serviced as soon as the i bit is cleared. table 4-1. vector addresses for interrupts and resets function source local mask global mask priority (1 = highest) vector address reset power-on reset none none 1 $3ffe ? $3fff reset pin cop watchdog software interrupt (swi) user code none none same priority as instruction $3ffc ? $3ffd external interrupt irq pin none i bit 2 $3ffa ? $3ffb port b pins timer interrupts icf bit icie bit i bit 3 $3ff8 ? $3ff9 ocf bit ocie bit tof bit toie bit sci interrupts tdre bit tcie bit i bit 4 $3ff6 ? $3ff7 tc bit rdrf bit rie bit or bit idle bit ilie bit spi interrupts spif bit spie bit i bit 5 $3ff4 ? $3ff5 modf bit
non-disclosure agreement required interrupts advance information MC68HC05C9A ? rev. 5.0 44 interrupts motorola 4.5 timer interrupt three different timer interrupt flags cause a timer interrupt whenever they are set and enabled. the interrupt flags are in the timer status register (tsr), and the enable bits are in the timer control register (tcr). any of these interrupts will vector to the same interrupt service routine, located at the address specified by the contents of memory locations $3ff8 and $3ff9. 4.6 sci interrupt five different sci interrupt flags cause an sci interrupt whenever they are set and enabled. the interrupt flags are in the sci status register (scsr), and the enable bits are in the sci control register 2 (sccr2). any of these interrupts will vector to the same interrupt service routine, located at the address specified by the contents of memory locations $3ff6 and $3ff7. 4.7 spi interrupt two different spi interrupt flags cause an spi interrupt whenever they are set and enabled. the interrupt flags are in the spi status register (spsr), and the enable bits are in the spi control register (spcr). either of these interrupts will vector to the same interrupt service routine, located at the address specified by the contents of memory locations $3ff4 and $3ff5.
interrupts spi interrupt MC68HC05C9A ? rev. 5.0 advance information motorola interrupts 45 non-disclosure agreement required figure 4-1. interrupt flowchart fetch next instruction swi instruction ? rti instruction ? execute restore registers from stack: ccr, a, x, pc n y n y instruction stack pc, x, a, ccr set i bit in cc register load pc from: swi: $3ffc ? $3ffd irq : $3ffa ? $3ffb timer: $3ff8 ? $3ff9 sci: $3ff6 ? $3ff7 spi: $3ff4 ? $3ff5 internal spi interrupt internal sci interrupt y y y y n n n n n internal timer interrupt clear irq request latch irq or port b external interrupt i bit in ccr set? from reset y
non-disclosure agreement required interrupts advance information MC68HC05C9A ? rev. 5.0 46 interrupts motorola
MC68HC05C9A ? rev. 5.0 advance information motorola resets 47 non-disclosure agreement required advance information ? MC68HC05C9A section 5. resets 5.1 contents 5.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .47 5.3 power-on reset (por) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .48 5.4 reset pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 5.5 computer operating properly (cop) reset . . . . . . . . . . . . . . .50 5.5.1 cop reset register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 5.5.2 cop control register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 5.6 cop during wait mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .54 5.7 cop during stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .54 5.8 clock monitor reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 5.2 introduction the MC68HC05C9A microcontroller unit (mcu) can be reset four ways:  initial power-on reset function  active low input to the reset pin  computer operating properly (cop)  clock monitor
non-disclosure agreement required resets advance information MC68HC05C9A ? rev. 5.0 48 resets motorola a reset immediately stops the operation of the instruction being executed, initializes some control bits, and loads the program counter with a user-defined reset vector address. figure 5-1 is a block diagram of the reset sources. figure 5-1. reset sources 5.3 power-on reset (por) a power-on reset (por) occurs when a positive transition is detected on v dd . the power-on reset is strictly for power turn-on conditions and should not be used to detect a drop in the power supply voltage. there is a 4064 internal processor clock cycle (t cyc ) oscillator stabilization delay after the oscillator becomes active. the reset pin will output a logic 0 during the 4064-cycle delay. if the reset pin is low after the end of this 4064-cycle delay, the mcu will remain in the reset condition until reset is driven high externally. v dd reset reset latch power-on reset d internal clock r rst to cpu and subsystems q stop clock monitor cop watchdog
resets reset pin MC68HC05C9A ? rev. 5.0 advance information motorola resets 49 non-disclosure agreement required 5.4 reset pin the mcu is reset when a logic 0 is applied to the reset input for a period of one and one-half machine cycles (t rl ). however, to differentiate between an external reset and an internal reset (generated from the cop or clock monitor), any externally driven reset must be active (logic 0) for at least eight t cyc . figure 5-2. power-on reset and reset reset osc1 (2) internal clock (1) internal address bus (1) v dd internal data bus (1) t rl new pch new pcl op code op code pch pcl t cyc 4064 t vddr dummy $3fff new pc new pc $3ffe $3ffe $3ffe new pc new pc $3ffe $3fff $3ffe dummy notes: 1. internal timing signal and bus information are not available externally. 2. osc1 line is not meant to represent frequency. it is meant to represent only time. 3. the next rising edge of the internal processor clock following the rising edge of reset initiates the reset sequence. note 4 4. reset outputs v ol during 4064 power-on reset cycles. note 3 t cyc
non-disclosure agreement required resets advance information MC68HC05C9A ? rev. 5.0 50 resets motorola 5.5 computer operating properly (cop) reset this device includes a watchdog cop feature which guards against program run-away failures. a timeout of the cop timer generates a cop reset. the cop watchdog is a software error detection system that automatically times out and resets the mcu if not cleared periodically by a program sequence. the cop is controlled with two registers, one to reset the cop timer and the other to enable and control cop and clock monitor functions. figure 5-3 shows a block diagram of the cop. figure 5-3. cop block diagram 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 4 4 2 2 2 2 2 2 2 13 2 15 2 17 2 19 2 21 coprst cm0 cm1 16-bit timer system internal cpu clock cop
resets computer operating properly (cop) reset MC68HC05C9A ? rev. 5.0 advance information motorola resets 51 non-disclosure agreement required 5.5.1 cop reset register the cop reset register (coprst), shown in figure 5-4 , is a write-only register used to reset the cop. the sequence required to reset the cop timer is:  write $55 to the cop reset register  write $aa to the cop reset register both write operations must occur in the order listed, but any number of instructions may be executed between the two write operations provided that the cop does not time out between the two writes. the elapsed time between software resets must not be greater than the cop timeout period. if the cop should time out, a system reset will occur and the device will be re-initialized in the same fashion as a power-on reset or reset. reading this register does not return valid data. address: $001d bit 7654321bit 0 read: write: bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reset:00000000 = unimplemented figure 5-4. cop reset register (coprst)
non-disclosure agreement required resets advance information MC68HC05C9A ? rev. 5.0 52 resets motorola 5.5.2 cop control register the cop control register (copcr), shown in figure 5-5 , performs these functions:  enables clock monitor function  enables cop function  selects timeout duration of cop timer and flags these conditions:  cop timeout  clock monitor reset copf ? computer operating properly flag reading the cop control register clears copf. 1 = cop or clock monitor reset has occurred. 0 = no cop or clock monitor reset has occurred. cme ? clock monitor enable bit this bit is readable any time, but may be written only once. 1 = clock monitor enabled 0 = clock monitor disabled address: $001e bit 7654321bit 0 read: 0 0 0 copf cme cope cm1 cm0 write: reset:000u0000 = unimplemented u = undetermined figure 5-5. cop control register (copcr)
resets computer operating properly (cop) reset MC68HC05C9A ? rev. 5.0 advance information motorola resets 53 non-disclosure agreement required cope ? cop enable bit this bit is readable any time. cope, cm1, and cm0 together may be written with a single write, only once, after reset. this bit is cleared by reset. 1 = cop enabled 0 = cop disabled cm1 ? cop mode bit 1 used in conjunction with cm0 to establish the cop timeout period, this bit is readable any time. cope, cm1, and cm0 together may be written with a single write, only once, after reset. this bit is cleared by reset. see table 5-1 for timeout period options. cm0 ? cop mode bit 0 used in conjunction with cm1 to establish the cop timeout period, this bit is readable any time. cope, cm1, and cm0 together may be written with a single write, only once, after reset. this bit is cleared by reset. see table 5-1 for timeout period options. bits 7 ? 5 ? not used these bits always read as 0. table 5-1. cop timeout period cm1 cm0 f op /2 15 divide by timeout period (f osc = 2.0 mhz) timeout period (f osc = 4.0 mhz) 0 0 1 32.77 ms 16.38 ms 0 1 4 131.07 ms 65.54 ms 1 0 16 524.29 ms 262.14 ms 1 1 64 2.097 s 1.048 s
non-disclosure agreement required resets advance information MC68HC05C9A ? rev. 5.0 54 resets motorola 5.6 cop during wait mode the cop will continue to operate normally during wait mode. the software must pull the device out of wait mode periodically and reset the cop to prevent a system reset. 5.7 cop during stop mode stop mode disables the oscillator circuit and thereby turns the clock off for the entire device. the cop counter will be reset when stop mode is entered. if a reset is used to exit stop mode, the cop counter will be reset after the 4064 cycles of delay after stop mode. if an irq is used to exit stop mode, the cop counter will not be reset after the 4064-cycle delay and will have that many cycles already counted when control is returned to the program. in the event that an inadvertent stop instruction is executed, the cop will not provide a reset. the clock monitor function provides protection for this situation. 5.8 clock monitor reset the clock monitor circuit can provide a system reset if the clock stops for any reason, including stop mode. when the cme bit in the cop control register is set, the clock monitor detects the absence of the internal bus clock for a certain period of time. the timeout period is dependent on the processing parameters and varies from 5 s to 100 s, which implies that systems using a bus clock rate of 200 khz or less should not use the clock monitor. if a slow or absent clock is detected, the clock monitor causes a system reset. the reset is issued to the external system via the bidirectional reset pin for four bus cycles if the clock is slow or until the clocks recover in the case where the clocks are absent.
MC68HC05C9A ? rev. 5.0 advance information motorola low-power modes 55 non-disclosure agreement required advance information ? MC68HC05C9A section 6. low-power modes 6.1 contents 6.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55 6.3 stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .55 6.4 wait mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .56 6.2 introduction this section describes the low-power stop and wait modes. 6.3 stop mode the stop instruction places the microcontroller unit (mcu) in its lowest- power consumption mode. in stop mode, the internal oscillator is turned off, halting all internal processing, including timer operation. during stop mode, the tcr bits are altered to remove any pending timer interrupt request and to disable any further timer interrupts. the timer prescaler is cleared. the i bit in the condition code register (ccr) is cleared to enable external interrupts. all other registers and memory remain unaltered. all input/output (i/o) lines remain unchanged. the processor can be brought out of stop mode only by an external interrupt or reset. see figure 6-1 .
non-disclosure agreement required low-power modes advance information MC68HC05C9A ? rev. 5.0 56 low-power modes motorola figure 6-1. stop recovery timing diagram 6.4 wait mode the wait instruction places the mcu in a low-power consumption mode, but wait mode consumes more power than stop mode. all central processor unit (cpu) action is suspended, but the timer, serial communications interface (sci), serial peripheral interface (spi), and the oscillator remain active. any interrupt or reset will cause the mcu to exit wait mode. during wait mode, the i bit in the ccr is cleared to enable interrupts. all other registers, memory, and i/o lines remain in their previous state. the timer, sci, and spi may be enabled to allow a periodic exit from the wait mode. $3ffe $3ffe $3ffe $3ffe $3fff internal address bus internal clock irq (3) irq (2) reset osc1 (1) t ilch 4064 t cyc reset or interrupt vector fetch t lih t rl notes: 1. represents the internal gating of the osc1 pin 2. irq pin edge-sensitive mask option 3. irq pin level and edge-sensitive mask option
MC68HC05C9A ? rev. 5.0 advance information motorola input/output ports 57 non-disclosure agreement required advance information ? MC68HC05C9A section 7. input/output ports 7.1 contents 7.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .57 7.3 port a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .57 7.4 port b . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .58 7.5 port c . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .59 7.6 port d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .59 7.2 introduction this section briefly describes the 31 input/output (i/o) lines arranged as one 7-bit and three 8-bit ports. all of these port pins are programmable as either inputs or outputs under software control of the data direction registers. note: to avoid a glitch on the output pins, write data to the i/o port data register before writing a 1 to the corresponding data direction register. 7.3 port a port a is an 8-bit bidirectional port which does not share any of its pins with other subsystems. the port a data register is at $0000 and the data direction register (ddr) is at $0004. the contents of the port a data register are indeterminate at initial power-up and must be initialized by user software. reset does not affect the data registers, but clears the data direction registers, thereby returning the ports to inputs. writing a 1 to a ddr bit sets the corresponding port bit to output mode. a block diagram of the port logic is shown in figure 7-1 .
non-disclosure agreement required input/output ports advance information MC68HC05C9A ? rev. 5.0 58 input/output ports motorola figure 7-1. port a i/o circuit 7.4 port b port b is an 8-bit bidirectional port. the port b data register is at $0001 and the data direction register (ddr) is at $0005. the contents of the port b data register are indeterminate at initial powerup and must be initialized by user software. reset does not affect the data registers, but clears the data direction registers, thereby returning the ports to inputs. writing a one to a ddr bit sets the corresponding port pin to output mode. each of the port b pins has an optional external interrupt capability that can be enabled by mask option. the interrupt option also enables a pullup device when the pin is configured as an input. the edge or edge- and level-sensitivity of the irq pin will also pertain to the enabled port b pins. care needs to be taken when using port b pins that have the pullup enabled. before switching from an output to an input, the data should be preconditioned to a 1 to prevent an interrupt from occurring. the port b logic is shown in figure 7-2 . data direction register bit latched output data bit i/o pin input reg. bit input i/o output internal hc05 connections
input/output ports port c MC68HC05C9A ? rev. 5.0 advance information motorola input/output ports 59 non-disclosure agreement required 7.5 port c port c is an 8-bit bidirectional port. the port c data register is at $0002 and the data direction register (ddr) is at $0006. the contents of the port c data register are indeterminate at initial powerup and must be initialized by user software. reset does not affect the data registers, but clears the data direction registers, thereby returning the ports to inputs. writing a 1 to a ddr bit sets the corresponding port bit to output mode. pc7 has a high current sink and source capability. figure 7-1 is also applicable to port c. 7.6 port d port d is a 7-bit bidirectional port. four of its pins are shared with the spi subsystem and two more are shared with the sci subsystem. the port d data register is at $0003 and the data direction register is at $0007. the contents of the port d data register are indeterminate at initial powerup and must be initialized by user software. during reset all seven bits become valid input ports because the ddr bits are cleared and the special function output drivers associated with the sci and spi subsystems are disabled, thereby returning the ports to inputs. writing a 1 to a ddr bit sets the corresponding port bit to output mode.
non-disclosure agreement required input/output ports advance information MC68HC05C9A ? rev. 5.0 60 input/output ports motorola figure 7-2. port b i/o logic data direction register b bit ddrb7 pbx external interrupt request port b data register bit pb7 read $0005 write $0001 read $0001 reset internal data bus write $0005 port b external interrupt from other v dd port b pins d c q r q i bit v dd from ccr reset external interrupt vector fetch irq mask option v dd enabled disabled edge only edge and level software controlled option
MC68HC05C9A ? rev. 5.0 advance information motorola capture/compare timer 61 non-disclosure agreement required advance information ? MC68HC05C9A section 8. capture/compare timer 8.1 content 8.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .61 8.3 timer operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .62 8.3.1 input capture. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .63 8.3.2 output compare . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .63 8.4 timer i/o registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .64 8.4.1 timer control register . . . . . . . . . . . . . . . . . . . . . . . . . . . .64 8.4.2 timer status register . . . . . . . . . . . . . . . . . . . . . . . . . . . . .66 8.4.3 timer registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .67 8.4.4 alternate timer registers . . . . . . . . . . . . . . . . . . . . . . . . . .68 8.4.5 input capture registers . . . . . . . . . . . . . . . . . . . . . . . . . . .69 8.4.6 output compare registers . . . . . . . . . . . . . . . . . . . . . . . . .70 8.5 timer during wait mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .71 8.6 timer during stop mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .71 8.2 introduction this section describes the operation of the 16-bit capture/compare timer. figure 8-1 shows the structure of the capture/compare subsystem.
non-disclosure agreement required capture/compare timer advance information MC68HC05C9A ? rev. 5.0 62 capture/compare timer motorola figure 8-1. capture/compare timer block diagram 8.3 timer operation the core of the capture/compare timer is a 16-bit free-running counter. the counter provides the timing reference for the input capture and output compare functions. the input capture and output compare functions provide a means to latch the times at which external events occur, to measure input waveforms, and to generate output waveforms and timing delays. software can read the value in the 16-bit free-running counter at any time without affecting the counter sequence. because of the 16-bit timer architecture, the input/output (i/o) registers for the input capture and output compare functions are pairs of 8-bit registers. input capture register clock internal bus output compare register high byte low byte $16 $17 4 internal processor 16-bit free running counter counter alternate register 8-bit buffer high byte low byte $1a $1b $18 $19 high byte low byte $14 $15 output compare circuit overflow detect circuit edge detect circuit timer status reg. icf ocf tof $13 icie iedg olvl output level reg. reset timer control reg. $12 output level (tcmp) interrupt circuit toie ocie edge input (tcap) d clk c q
capture/compare timer timer operation MC68HC05C9A ? rev. 5.0 advance information motorola capture/compare timer 63 non-disclosure agreement required because the counter is 16 bits long and preceded by a fixed divide-by-4 prescaler, the counter rolls over every 262,144 internal clock cycles. timer resolution with a 4-mhz crystal is 2 s. 8.3.1 input capture the input capture function is a means to record the time at which an external event occurs. when the input capture circuitry detects an active edge on the tcap pin, it latches the contents of the timer registers into the input capture registers. the polarity of the active edge is programmable. latching values into the input capture registers at successive edges of the same polarity measures the period of the input signal on the tcap pin. latching values into the input capture registers at successive edges of opposite polarity measures the pulse width of the signal. 8.3.2 output compare the output compare function is a means of generating an output signal when the 16-bit counter reaches a selected value. software writes the selected value into the output compare registers. on every fourth internal clock cycle the output compare circuitry compares the value of the counter to the value written in the output compare registers. when a match occurs, the timer transfers the programmable output level bit (olvl) from the timer control register to the tcmp pin. the programmer can use the output compare register to measure time periods, to generate timing delays, or to generate a pulse of specific duration or a pulse train of specific frequency and duty cycle on the tcmp pin.
non-disclosure agreement required capture/compare timer advance information MC68HC05C9A ? rev. 5.0 64 capture/compare timer motorola 8.4 timer i/o registers these i/o registers control and monitor timer operation:  timer control register (tcr)  timer status register (tsr)  timer registers (trh and trl)  alternate timer registers (atrh and atrl)  input capture registers (icrh and icrl)  output compare registers (ocrh and ocrl) 8.4.1 timer control register the timer control register (tcr), shown in figure 8-2 , performs these functions:  enables input capture interrupts  enables output compare interrupts  enables timer overflow interrupts  controls the active edge polarity of the tcap signal  controls the active level of the tcmp output figure 8-2. timer control register (tcr) address: $0012 bit 7654321bit 0 read: icie ocie toie 000 iedg olvl write: reset:000000u0 = unimplemented u = undetermined
capture/compare timer timer i/o registers MC68HC05C9A ? rev. 5.0 advance information motorola capture/compare timer 65 non-disclosure agreement required icie ? input capture interrupt enable bit this read/write bit enables interrupts caused by an active signal on the tcap pin. reset clears the icie bit. 1 = input capture interrupts enabled 0 = input capture interrupts disabled ocie ? output compare interrupt enable bit this read/write bit enables interrupts caused by an active signal on the tcmp pin. reset clears the ocie bit. 1 = output compare interrupts enabled 0 = output compare interrupts disabled toie ? timer overflow interrupt enable bit this read/write bit enables interrupts caused by a timer overflow. reset clears the toie bit. 1 = timer overflow interrupts enabled 0 = timer overflow interrupts disabled iedg ? input edge bit the state of this read/write bit determines whether a positive or negative transition on the tcap pin triggers a transfer of the contents of the timer register to the input capture register. resets have no effect on the iedg bit. 1 = positive edge (low to high transition) triggers input capture. 0 = negative edge (high to low transition) triggers input capture. olvl ? output level bit the state of this read/write bit determines whether a logic 1 or logic 0 appears on the tcmp pin when a successful output compare occurs. reset clears the olvl bit. 1 = tcmp goes high on output compare. 0 = tcmp goes low on output compare.
non-disclosure agreement required capture/compare timer advance information MC68HC05C9A ? rev. 5.0 66 capture/compare timer motorola 8.4.2 timer status register the timer status register (tsr), shown in figure 8-3 , contains flags to signal these conditions:  an active signal on the tcap pin, transferring the contents of the timer registers to the input capture registers  a match between the 16-bit counter and the output compare registers, transferring the olvl bit to the tcmp pin  a timer roll over from $ffff to $0000 icf ? input capture flag the icf bit is set automatically when an edge of the selected polarity occurs on the tcap pin. clear the icf bit by reading the timer status register with icf set and then reading the low byte ($0015) of the input capture registers. resets have no effect on icf. ocf ? output compare flag the ocf bit is set automatically when the value of the timer registers matches the contents of the output compare registers. clear the ocf bit by reading the timer status register with ocf set and then reading the low byte ($0017) of the output compare registers. resets have no effect on ocf. tof ? timer overflow flag the tof bit is set automatically when the 16-bit counter rolls over from $ffff to $0000. clear the tof bit by reading the timer status register with tof set, and then reading the low byte ($0019) of the timer registers. resets have no effect on tof. address: $0013 bit 7654321bit 0 read: icf ocf tof 00000 write: reset:uuu00000 = unimplemented u = unaffected figure 8-3. timer status register (tsr)
capture/compare timer timer i/o registers MC68HC05C9A ? rev. 5.0 advance information motorola capture/compare timer 67 non-disclosure agreement required 8.4.3 timer registers the timer registers (trh and trl), shown in figure 8-4 , contain the current high and low bytes of the 16-bit counter. reading trh before reading trl causes trl to be latched until trl is read. reading trl after reading the timer status register clears the timer overflow flag (tof). writing to the timer registers has no effect. figure 8-4. timer registers (trh and trl) address: $0018 ? trh bit 7654321bit 0 read: bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 write reset:11111111 address: $0019 ? trl bit 7654321bit 0 read: bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 write: reset:11111100 = unimplemented
non-disclosure agreement required capture/compare timer advance information MC68HC05C9A ? rev. 5.0 68 capture/compare timer motorola 8.4.4 alternate timer registers the alternate timer registers (atrh and atrl), shown in figure 8-5 , contain the current high and low bytes of the 16-bit counter. reading atrh before reading atrl causes atrl to be latched until atrl is read. reading atrl has no effect on the timer overflow flag (tof). writing to the alternate timer registers has no effect. figure 8-5. alternate timer registers (atrh and atrl) note: to prevent interrupts from occurring between readings of atrh and atrl, set the interrupt flag in the condition code register before reading atrh, and clear the flag after reading atrl. address: $001a ? atrh bit 7654321bit 0 read: bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 write: reset:11111111 address: $001b ? atrl bit 7654321bit 0 read: bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 write: reset:11111100 = unimplemented
capture/compare timer timer i/o registers MC68HC05C9A ? rev. 5.0 advance information motorola capture/compare timer 69 non-disclosure agreement required 8.4.5 input capture registers when a selected edge occurs on the tcap pin, the current high and low bytes of the 16-bit counter are latched into the input capture registers. reading icrh before reading icrl inhibits further capture until icrl is read. reading icrl after reading the status register clears the input capture flag (icf). writing to the input capture registers has no effect. figure 8-6. input capture registers (icrh and icrl) note: to prevent interrupts from occurring between readings of icrh and icrl, set the interrupt flag in the condition code register before reading icrh, and clear the flag after reading icrl. address: $0014 ? icrh bit 7654321bit 0 read: bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 write: reset: unaffected by reset address: $0015 ? icrl bit 7654321bit 0 read: bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 write: reset: unaffected by reset = unimplemented
non-disclosure agreement required capture/compare timer advance information MC68HC05C9A ? rev. 5.0 70 capture/compare timer motorola 8.4.6 output compare registers when the value of the 16-bit counter matches the value in the output compare registers, the planned tcmp pin action takes place. writing to ocrh before writing to ocrl inhibits timer compares until ocrl is written. reading or writing to ocrl after the timer status register clears the output compare flag (ocf). figure 8-7. output compare registers (ocrh and ocrl) to prevent ocf from being set between the time it is read and the time the output compare registers are updated, use this procedure: 1. disable interrupts by setting the i bit in the ccr. 2. write to ocrh. compares are now inhibited until ocrl is written. 3. clear bit ocf by reading timer status register (tsr). 4. enable the output compare function by writing to ocrl. 5. enable interrupts by clearing the i bit in the ccr. address: $0016 ? ocrh bit 7654321bit 0 write: bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 read: reset: unaffected by reset address: $0017 ? ocrl bit 7654321bit 0 write: bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 read: reset: unaffected by reset
capture/compare timer timer during wait mode MC68HC05C9A ? rev. 5.0 advance information motorola capture/compare timer 71 non-disclosure agreement required 8.5 timer during wait mode the central processor unit (cpu) clock halts during wait mode, but the timer remains active. if interrupts are enabled, a timer interrupt will cause the processor to exit wait mode. 8.6 timer during stop mode in stop mode, the timer stops counting and holds the last count value if stop is exited by an interrupt. if stop is exited by reset, the counters are forced to $fffc. during stop, if at least one valid input capture edge occurs at the tcap pins, the input capture detect circuit is armed. this does not set any timer flags or wake up the microcontroller unit (mcu). but if an interrupt is used to exit stop mode, there is an active input capture flag and data from the first valid edge that occurred during the stop mode. if reset is used to exit stop mode, then no input capture flag or data remains, even if a valid input capture edge occurred.
non-disclosure agreement required capture/compare timer advance information MC68HC05C9A ? rev. 5.0 72 capture/compare timer motorola
MC68HC05C9A ? rev. 5.0 advance information motorola serial communications interface (sci) 73 non-disclosure agreement required advance information ? MC68HC05C9A section 9. serial communications interface (sci) 9.1 content 9.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .74 9.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .74 9.4 sci receiver features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 9.5 sci transmitter features . . . . . . . . . . . . . . . . . . . . . . . . . . . . .76 9.6 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76 9.7 data format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .78 9.8 receiver wakeup operation. . . . . . . . . . . . . . . . . . . . . . . . . . .78 9.8.1 idle line wakeup. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .79 9.8.2 address mark wakeup . . . . . . . . . . . . . . . . . . . . . . . . . . . .79 9.9 receive data in (rdi). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 9.10 start bit detection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .81 9.11 transmit data out (tdo) . . . . . . . . . . . . . . . . . . . . . . . . . . . . .82 9.12 sci i/o registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 9.12.1 sci data register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .83 9.12.2 sci control register 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 9.12.3 sci control register 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 9.12.4 sci status register. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 9.12.5 baud rate register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .89
non-disclosure agreement required serial communications interface (sci) advance information MC68HC05C9A ? rev. 5.0 74 serial communications interface (sci) motorola 9.2 introduction this section describes the on-chip asynchronous serial communications interface (sci). the sci allows full-duplex, asynchronous, rs232 or rs422 serial communication between the microcontroller unit (mcu) and remote devices, including other mcus. the transmitter and receiver of the sci operate independently, although they use the same baud rate generator. 9.3 features features of the sci include:  standard mark/space non-return-to-zero format  full-duplex operation  32 programmable baud rates  programmable 8-bit or 9-bit character length  separately enabled transmitter and receiver  two receiver wakeup methods: ? idle line wakeup ? address mark wakeup  interrupt-driven operation capability with five interrupt flags: ? transmitter data register empty ? transmission complete ? transmission data register full ? receiver overrun ? idle receiver input  receiver framing error detection  1/16 bit-time noise detection
serial communications interface (sci) features MC68HC05C9A ? rev. 5.0 advance information motorola serial communications interface (sci) 75 non-disclosure agreement required figure 9-1. serial communications interface block diagram note: the serial communications data register (sci scdr) is controlled by the internal r/w signal. it is the transmit data register when written to and the receive data register when read. + + internal bus sci interrupt transmit receive tdo pin rdi transmitter control receiver control clock pin receiver flag control data data tie tcie rie ilie te re sbk rwu 7 6 5 4 3 2 1 0 $000f sccr2 scsr $0010 sccr1 $000e trde tc rdrf idle or nf fe te sbk $0011 r8 t8 m wake 0 1 2 4 3 6 5 7 765 2 3 4 1 wakeup unit receive data shift register transmit data shift register $0011 7 &&&& register register
non-disclosure agreement required serial communications interface (sci) advance information MC68HC05C9A ? rev. 5.0 76 serial communications interface (sci) motorola 9.4 sci receiver features features of the sci receiver include:  receiver wakeup function (idle line or address bit)  idle line detection  framing error detection  noise detection  overrun detection  receiver data register full flag 9.5 sci transmitter features features of the sci transmitter include:  transmit data register empty flag  transmit complete flag  send break 9.6 functional description a block diagram of the sci is shown in figure 9-1 . option bits in serial control register1 (sccr1) select the wakeup method (wake bit) and data word length (m bit) of the sci. sccr2 provides control bits that individually enable the transmitter and receiver, enable system interrupts, and provide the wakeup enable bit (rwu) and the send break code bit (sbk). control bits in the baud rate register (baud) allow the user to select one of 32 different baud rates for the transmitter and receiver. data transmission is initiated by writing to the serial communications data register (scdr). provided the transmitter is enabled, data stored in the scdr is transferred to the transmit data shift register. this transfer of data sets the transmit data register empty flag (tdre) in the sci status register (scsr) and generates an interrupt (if transmitter interrupts are enabled). the transfer of data to the transmit data shift
serial communications interface (sci) functional description MC68HC05C9A ? rev. 5.0 advance information motorola serial communications interface (sci) 77 non-disclosure agreement required register is synchronized with the bit rate clock (see figure 9-2 ). all data is transmitted least significant bit first. upon completion of data transmission, the transmission complete flag (tc) in the scsr is set (provided no pending data, preamble, or break is to be sent) and an interrupt is generated (if the transmit complete interrupt is enabled). if the transmitter is disabled, and the data, preamble, or break (in the transmit data shift register) has been sent, the tc bit will be set also. this will also generate an interrupt if the transmission complete interrupt enable bit (tcie) is set. if the transmitter is disabled during a transmission, the character being transmitted will be completed before the transmitter gives up control of the tdo pin. when scdr is read, it contains the last data byte received, provided that the receiver is enabled. the receive data register full flag bit (rdrf) in the scsr is set to indicate that a data byte has been transferred from the input serial shift register to the scdr; this will cause an interrupt if the receiver interrupt is enabled. the data transfer from the input serial shift register to the scdr is synchronized by the receiver bit rate clock. the or (overrun), nf (noise), or fe (framing) error flags in the scsr may be set if data reception errors occurred. an idle line interrupt is generated if the idle line interrupt is enabled and the idle bit (which detects idle line transmission) in scsr is set. this allows a receiver that is not in the wakeup mode to detect the end of a message, or the preamble of a new message, or to re-synchronize with the transmitter. a valid character must be received before the idle line condition or the idle bit will not be set and idle line interrupt will not be generated. figure 9-2. rate generator division osc freq (f osc ) 2 bus freq (f op ) scp0 ? scp1 sci prescaler select n scr0 ? scr2 sci rate select m 16 sci trans clock (tx) sci receive clock (rt) control control
non-disclosure agreement required serial communications interface (sci) advance information MC68HC05C9A ? rev. 5.0 78 serial communications interface (sci) motorola 9.7 data format receive data or transmit data is the serial data that is transferred to the internal data bus from the receive data input pin (rdi) or from the internal bus to the transmit data output pin (tdo). the non-return-to- zero (nrz) data format shown in figure 9-3 is used and must meet these criteria:  the idle line is brought to a logic 1 state prior to transmission/ reception of a character.  a start bit (logic 0) is used to indicate the start of a frame.  the data is transmitted and received least significant bit first.  a stop bit (logic 1) is used to indicate the end of a frame. a frame consists of a start bit, a character of eight or nine data bits, and a stop bit.  a break is defined as the transmission or reception of a low (logic 0) for at least one complete frame time. figure 9-3. data format 9.8 receiver wakeup operation the receiver logic hardware also supports a receiver wakeup function which is intended for systems having more than one receiver. with this function a transmitting device directs messages to an individual receiver or group of receivers by passing addressing information as the initial byte(s) of each message. the wakeup function allows receivers not addressed to remain in a dormant state for the remainder of the unwanted message. this eliminates any further software overhead to service the remaining characters of the unwanted message and thus improves system performance. idle line 012345678 0 stop start start control bit m selects 8- or 9-bit data
serial communications interface (sci) receiver wakeup operation MC68HC05C9A ? rev. 5.0 advance information motorola serial communications interface (sci) 79 non-disclosure agreement required the receiver is placed in wakeup mode by setting the receiver wakeup bit (rwu) in the sccr2 register. while rwu is set, all of the receiver- related status flags (rdrf, idle, or, nf, and fe) are inhibited (cannot become set). note: the idle line detect function is inhibited while the rwu bit is set. although rwu may be cleared by a software write to sccr2, it would be unusual to do so. normally, rwu is set by software and is cleared automatically in hardware by one of these methods: idle line wakeup or address mark wakeup. 9.8.1 idle line wakeup in idle line wakeup mode, a dormant receiver wakes up as soon as the rdi line becomes idle. idle is defined as a continuous logic high level on the rdi line for 10 (or 11) full bit times. systems using this type of wakeup must provide at least one character time of idle between messages to wake up sleeping receivers, but must not allow any idle time between characters within a message. 9.8.2 address mark wakeup in address mark wakeup, the most significant bit (msb) in a character is used to indicate whether it is an address (logic 1) or data (logic 0) character. sleeping receivers will wake up whenever an address character is received. systems using this method for wakeup would set the msb of the first character of each message and leave it clear for all other characters in the message. idle periods may be present within messages and no idle time is required between messages for this wakeup method.
non-disclosure agreement required serial communications interface (sci) advance information MC68HC05C9A ? rev. 5.0 80 serial communications interface (sci) motorola 9.9 receive data in (rdi) receive data is the serial data that is applied through the input line and the sci to the internal bus. the receiver circuitry clocks the input at a rate equal to 16 times the baud rate. this time is referred to as the rt rate in figure 9-4 and as the receiver clock in figure 9-6 . figure 9-4. sci examples of start bit sampling techniques the receiver clock generator is controlled by the baud rate register; however, the sci is synchronized by the start bit, independent of the transmitter. once a valid start bit is detected, the start bit, each data bit, and the stop bit are sampled three times at rt intervals 8rt, 9rt, and 10rt (1rt is the position where the bit is expected to start), as shown in figure 9-5 . the value of the bit is determined by voting logic which takes the value of the majority of the samples. a noise flag is set when all three samples on a valid start bit or data bit or the stop bit do not agree. figure 9-5. sci sampling technique used on all bits 111111110000 111111110010 111011110 0 0 0 noise noi se start start start rdi rdi rdi idle 1rt 2rt 3rt 4rt 5rt 6rt 7rt rt clock edges for all three examples 16x internal sampling clock 9rt 8rt 10rt 16rt 1rt 16rt 1rt samples next bit previous bit rdi
serial communications interface (sci) start bit detection MC68HC05C9A ? rev. 5.0 advance information motorola serial communications interface (sci) 81 non-disclosure agreement required 9.10 start bit detection when the input (idle) line is detected low, it is tested for three more sample times (referred to as the start edge verification samples in figure 9-4 ). if at least two of these three verification samples detect a logic 0, a valid start bit has been detected; otherwise, the line is assumed to be idle. a noise flag is set if all three verification samples do not detect a logic 0. thus, a valid start bit could be assumed with a set noise flag present. if a framing error has occurred without detection of a break (10 0s for 8- bit format or 11 0s for 9-bit format), the circuit continues to operate as if there actually was a stop bit, and the start edge will be placed artificially. the last bit received in the data shift register is inverted to a logic 1, and the three logic 1 start qualifiers (shown in figure 9-4 ) are forced into the sample shift register during the interval when detection of a start bit is anticipated (see figure 9-6 ); therefore, the start bit will be accepted no sooner than it is anticipated. figure 9-6. sci artificial start following a frame error data expected stop data samples artificial edge start bit data rdi data expected stop data samples start edge start bit data rdi a) case 1: receive line low during artificial edge b) case 2: receive line high during expected start edge
non-disclosure agreement required serial communications interface (sci) advance information MC68HC05C9A ? rev. 5.0 82 serial communications interface (sci) motorola if the receiver detects that a break (rdrf = 1, fe = 1, receiver data register = $003b) produced the framing error, the start bit will not be artificially induced and the receiver must actually detect a logic 1 before the start bit can be recognized (see figure 9-7 ). figure 9-7. sci start bit following a break 9.11 transmit data out (tdo) transmit data is the serial data from the internal data bus that is applied through the sci to the output line. data format is as discussed in 9.7 data format and shown in figure 9-3 . the transmitter generates a bit time by using a derivative of the rt clock, thus producing a transmission rate equal to 1/16th that of the receiver sample clock. 9.12 sci i/o registers these i/o registers control and monitor sci operation:  sci data register (scdr)  sci control register 1 (sccr1)  sci control register 2 (sccr2)  sci status register (scsr) expected stop data samples detected as valid start edge start bit rdi break start qualifiers start edge verification samples
serial communications interface (sci) sci i/o registers MC68HC05C9A ? rev. 5.0 advance information motorola serial communications interface (sci) 83 non-disclosure agreement required 9.12.1 sci data register the sci data register (scdr), shown in figure 9-8 , is the buffer for characters received and for characters transmitted. 9.12.2 sci control register 1 the sci control register 1 (sccr1), shown in figure 9-9 , has these functions:  stores ninth sci data bit received and ninth sci data bit transmitted  controls sci character length  controls sci wakeup method r8 ? bit 8 (received) when the sci is receiving 9-bit characters, r8 is the ninth bit of the received character. r8 receives the ninth bit at the same time that the scdr receives the other eight bits. resets have no effect on the r8 bit. address: $0011 bit 7654321bit 0 read: scd7 sdc6 scd5 scd4 scd3 scd2 scd1 scd0 write: reset: unaffected by reset figure 9-8. sci data register (scdr) address: $000e bit 7654321bit 0 read: r8 t8 mwake write: reset:uu0uu000 = unimplemented u = undetermined figure 9-9. sci control register 1 (sccr1)
non-disclosure agreement required serial communications interface (sci) advance information MC68HC05C9A ? rev. 5.0 84 serial communications interface (sci) motorola t8 ? bit 8 (transmitted) when the sci is transmitting 9-bit characters, t8 is the ninth bit of the transmitted character. t8 is loaded into the transmit shift register at the same time that the scdr is loaded into the transmit register. resets have no effect on the t8 bit. m ? character length bit this read/write bit determines whether sci characters are 8 bits long or 9 bits long. the ninth bit can be used as an extra stop bit, as a receiver wakeup signal, or as a mark or space parity bit. resets have no effect on the m bit. 1 = 9-bit sci characters 0 = 8-bit sci characters wake ? wakeup method bit this read/write bit determines which condition wakes up the sci: a logic 1 (address mark) in the most significant bit (msb) position of a received character or an idle condition on the pd0/rdi pin. resets have no effect on the wake bit. 1 = address mark wakeup 0 = idle line wakeup 9.12.3 sci control register 2 sci control register 2 (sccr2), shown in figure 9-10 , has these functions:  enables the sci receiver and sci receiver interrupts  enables the sci transmitter and sci transmitter interrupts  enables sci receiver idle interrupts  enables sci transmission complete interrupts  enables sci wakeup  transmits sci break characters
serial communications interface (sci) sci i/o registers MC68HC05C9A ? rev. 5.0 advance information motorola serial communications interface (sci) 85 non-disclosure agreement required tie ? transmit interrupt enable bit this read/write bit enables sci interrupt requests when the tdre flag becomes set. resets clear the tie bit. 1 = tdre interrupt requests enabled 0 = tdre interrupt requests disabled tcie ? transmission complete interrupt enable bit this read/write bit enables sci interrupt requests when the tc flag becomes set. resets clear the tcie bit. 1 = tc interrupt requests enabled 0 = tc interrupt requests disabled rie ? receiver interrupt enable bit this read/write bit enables sci interrupt requests when the rdrf flag or the or flag becomes set. resets clear the rie bit. 1 = rdrf interrupt requests enabled 0 = rdrf interrupt requests disabled ilie ? idle line interrupt enable bit this read/write bit enables sci interrupt requests when the idle bit becomes set. resets clear the ilie bit. 1 = idle interrupt requests enabled 0 = idle interrupt requests disabled address: $000f bit 7654321bit 0 read: tie tcie rie ilie te re rwu sbk write: reset:00000000 figure 9-10. sci control register 2 (sccr2)
non-disclosure agreement required serial communications interface (sci) advance information MC68HC05C9A ? rev. 5.0 86 serial communications interface (sci) motorola te ? transmitter enable bit setting this read/write bit begins the transmission by sending a preamble of 10 or 11 logic 1s from the transmit shift register to the pd1/tdo pin. resets clear the te bit. 1 = transmission enabled 0 = transmission disabled re ? receiver enable bit setting this read/write bit enables the receiver. clearing the re bit disables the receiver and receiver interrupts but does not affect the receiver interrupt flags. resets clear the re bit. 1 = receiver enabled 0 = receiver disabled rwu ? receiver wakeup enable bit this read/write bit puts the receiver in a standby state. typically, data transmitted to the receiver clears the rwu bit and returns the receiver to normal operation. the wake bit in sccr1 determines whether an idle input or an address mark brings the receiver out of standby state. reset clears the rwu bit. 1 = standby state 0 = normal operation sbk ? send break bit setting this read/write bit continuously transmits break codes in the form of 10-bit or 11-bit groups of logic 0s. clearing the sbk bit stops the break codes and transmits a logic 1 as a start bit. reset clears the sbk bit. 1 = break codes being transmitted 0 = no break codes being transmitted
serial communications interface (sci) sci i/o registers MC68HC05C9A ? rev. 5.0 advance information motorola serial communications interface (sci) 87 non-disclosure agreement required 9.12.4 sci status register the sci status register (scsr), shown in figure 9-11 , contains flags to signal these conditions:  transfer of scdr data to transmit shift register complete  transmission complete  transfer of receive shift register data scdr complete  receiver input idle  noisy data  framing error tdre ? transmit data register empty flag this clearable, read-only flag is set when the data in the scdr transfers to the transmit shift register. tdre generates an interrupt request if the tie bit in sccr2 is also set. clear the tdre bit by reading the scsr with tdre set and then writing to the scdr. reset sets the tdre bit. software must initialize the tdre bit to logic 0 to avoid an instant interrupt request when turning the transmitter on. 1 = scdr data transferred to transmit shift register 0 = scdr data not transferred to transmit shift register tc ? transmission complete flag this clearable, read-only flag is set when the tdre bit is set, and no data, preamble, or break character is being transmitted. tdre generates an interrupt request if the tcie bit in sccr2 is also set. clear the tc bit by reading the scsr with tc set, and then writing to address: $0010 bit 7654321bit 0 read: tdre tc rdrf idle or nf fe write: reset:1100000 ? = unimplemented figure 9-11. sci status register (scsr)
non-disclosure agreement required serial communications interface (sci) advance information MC68HC05C9A ? rev. 5.0 88 serial communications interface (sci) motorola the scdr. reset sets the tc bit. software must initialize the tc bit to logic 0 to avoid an instant interrupt request when turning the transmitter on. 1 = no transmission in progress 0 = transmission in progress rdrf ? receive data register full flag this clearable, read-only flag is set when the data in the receive shift register transfers to the sci data register. rdrf generates an interrupt request if the rie bit in the sccr2 is also set. clear the rdrf bit by reading the scsr with rdrf set and then reading the scdr. 1 = received data available in scdr 0 = received data not available in scdr idle ? receiver idle flag this clearable, read-only flag is set when 10 or 11 consecutive logic 1s appear on the receiver input. idle generates an interrupt request if the ilie bit in the sccr2 is also set. clear the ilie bit by reading the scsr with idle set and then reading the scdr. 1 = receiver input idle 0 = receiver input not idle or ? receiver overrun flag this clearable, read-only flag is set if the scdr is not read before the receive shift register receives the next word. or generates an interrupt request if the rie bit in the sccr2 is also set. the data in the shift register is lost, but the data already in the scdr is not affected. clear the or bit by reading the scsr with or set and then reading the scdr. 1 = receive shift register full and rdrf = 1 0 = no receiver overrun nf ? receiver noise flag this clearable, read-only flag is set when noise is detected in data received in the sci data register. clear the nf bit by reading the scsr and then reading the scdr. 1 = noise detected in scdr 0 = no noise detected in scdr
serial communications interface (sci) sci i/o registers MC68HC05C9A ? rev. 5.0 advance information motorola serial communications interface (sci) 89 non-disclosure agreement required fe ? receiver framing error flag this clearable, read-only flag is set when there is a logic 0 where a stop bit should be in the character shifted into the receive shift register. if the received word causes both a framing error and an overrun error, the or flag is set and the fe flag is not set. clear the fe bit by reading the scsr and then reading the scdr. 1 = framing error 0 = no framing error 9.12.5 baud rate register the baud rate register (baud), shown in figure 9-12 , selects the baud rate for both the receiver and the transmitter. scp1 ? scp0 ? sci prescaler select bits these read/write bits control prescaling of the baud rate generator clock, as shown in table 9-1 . reset clears both scp1 and scp0. address: $000d bit 7654321bit 0 read: scp1 scp0 scr2 scr1 scr0 write: reset: ?? 00 ? uuu = unimplemented u = unaffected figure 9-12. baud rate register (baud) table 9-1. baud rate generator clock prescaling scp1 and scp0 baud rate generator clock 0 0 internal clock 1 0 1 internal clock 3 1 0 internal clock 4 1 1 internal clock 13
non-disclosure agreement required serial communications interface (sci) advance information MC68HC05C9A ? rev. 5.0 90 serial communications interface (sci) motorola scr2 ? scr0 ? sci baud rate select bits these read/write bits select the sci baud rate, as shown in table 9-2 . resets have no effect on the scr2 ? scr0 bits. table 9-2. baud rate selection scr2, scr1, and scr0 sci baud rate (baud) 0 0 0 prescaled clock 1 0 0 1 prescaled clock 2 0 1 0 prescaled clock 4 0 1 1 prescaled clock 8 1 0 0 prescaled clock 16 1 0 1 prescaled clock 32 1 1 0 prescaled clock 64 1 1 1 prescaled clock 128
MC68HC05C9A ? rev. 5.0 advance information motorola serial peripheral interface (spi) 91 non-disclosure agreement required advance information ? MC68HC05C9A section 10. serial peripheral interface (spi) 10.1 content 10.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .91 10.3 features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .92 10.4 spi signal description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 10.4.1 master in slave out (miso) . . . . . . . . . . . . . . . . . . . . . . . .93 10.4.2 master out slave in (mosi) . . . . . . . . . . . . . . . . . . . . . . . .93 10.4.3 serial clock (sck) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 10.4.4 slave select (ss) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .94 10.5 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 10.6 spi registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .97 10.6.1 serial peripheral control register. . . . . . . . . . . . . . . . . . . .97 10.6.2 serial peripheral status register . . . . . . . . . . . . . . . . . . . .99 10.6.3 serial peripheral data i/o register . . . . . . . . . . . . . . . . . .101 10.2 introduction the serial peripheral interface (spi) is an interface built into the device which allows several m68hc05 microcontroller units (mcu), or m68hc05 mcu plus peripheral devices, to be interconnected within a single printed circuit board. in an spi, separate wires are required for data and clock. in the spi format, the clock is not included in the data stream and must be furnished as a separate signal. an spi system may be configured in one containing one master mcu and several slave mcus or in a system in which an mcu is capable of being a master or a slave.
non-disclosure agreement required serial peripheral interface (spi) advance information MC68HC05C9A ? rev. 5.0 92 serial peripheral interface (spi) motorola 10.3 features spi features include:  full-duplex, 4-wire synchronous transfers  master or slave operation  bus frequency divided by 2 (maximum) master bit frequency  bus frequency (maximum) slave bit frequency  four programmable master bit rates  programmable clock polarity and phase  end-of-transmission interrupt flag  write collision flag protection  master-master mode fault protection capability 10.4 spi signal description the four basic signals (mosi, miso, sck, and ss ) are described here. each signal function is described for both the master and slave modes. note: any spi output line has to have its corresponding data direction register bit set. if this bit is clear, the line is disconnected from the spi logic and becomes a general-purpose input line. when the spi is enabled, any spi input line is forced to act as an input regardless of what is in the corresponding data direction register bit.
serial peripheral interface (spi) spi signal description MC68HC05C9A ? rev. 5.0 advance information motorola serial peripheral interface (spi) 93 non-disclosure agreement required figure 10-1. data clock timing diagram 10.4.1 master in/slave out (miso) the miso line is configured as an input in a master device and as an output in a slave device. it is one of the two lines that transfer serial data in one direction, with the most significant bit sent first. the miso line of a slave device is placed in the high-impedance state if the slave is not selected. 10.4.2 master out/slave in (mosi) the mosi line is configured as an output in a master device and as an input in a slave device. it is one of the two lines that transfer serial data in one direction with the most significant bit sent first. msb 5 3 64 21 0 internal strobe for data capture (all modes) miso/mosi sck sck sck sck ss cpol = 0 cpha = 0 cpol = 0 cpha = 1 cpol = 1 cpha = 1 cpol = 1 cpha = 0
non-disclosure agreement required serial peripheral interface (spi) advance information MC68HC05C9A ? rev. 5.0 94 serial peripheral interface (spi) motorola 10.4.3 serial clock (sck) the master clock is used to synchronize data movement both in and out of the device through its mosi and miso lines. the master and slave devices are capable of exchanging a byte of information during a sequence of eight clock cycles. since sck is generated by the master device, this line becomes an input on a slave device. as shown in figure 10-1 , four possible timing relationships may be chosen by using control bits cpol and cpha in the serial peripheral control register (spcr). both master and slave devices must operate with the same timing. the master device always places data on the mosi line a half cycle before the clock edge (sck), in order for the slave device to latch the data. two bits (spr0 and spr1) in the spcr of the master device select the clock rate. in a slave device, spr0 and spr1 have no effect on the operation of the spi. 10.4.4 slave select (ss ) the slave select (ss ) input line is used to select a slave device. it has to be low prior to data transactions and must stay low for the duration of the transaction.the ss line on the master must be tied high. in master mode, if the ss pin is pulled low during a transmission, a mode fault error flag (modf) is set in the spsr. in master mode the ss pin can be selected as a general-purpose output by writing a 1 in bit 5 of the port d data direction register, thus disabling the mode fault circuit. when cpha = 0, the shift clock is the or of ss with sck. in this clock phase mode, ss must go high between successive characters in an spi message. when cpha = 1, ss may be left low for several spi characters. in cases where there is only one spi slave mcu, its ss line could be tied to v ss as long as cpha = 1 clock modes are used.
serial peripheral interface (spi) functional description MC68HC05C9A ? rev. 5.0 advance information motorola serial peripheral interface (spi) 95 non-disclosure agreement required 10.5 functional description figure 10-2 shows a block diagram of the serial peripheral interface circuitry. when a master device transmits data to a slave via the mosi line, the slave device responds by sending data to the master device via the master ? s miso line. this implies full duplex transmission with both data out and data in synchronized with the same clock signal. thus, the byte transmitted is replaced by the byte received and eliminates the need for separate transmit-empty and receive-full status bits. a single status bit (spif) is used to signify that the input/output (i/o) operation has been completed. figure 10-2. serial peripheral interface block diagram s 6 7 543210 spe spie spi control register (spcr) mstr cpol cpha spr1 spr2 $000a wcol spif spi status register (spsr) 0 modf 0 0 $000b bit 6 bit 7 spi data register (spdr) bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 $000c dwom 00 spi shift register divider clock logic spdr ($000c) 7 6 5 4 3 2 1 0 modf wcol spif spr1 spr0 cpol cpha mstr spe spie pd3/ mosi pd2/ miso 2 32 16 4 select spi control internal data bus mstr s m m internal clock (xtal 2) spi clock (master) spi interrupt request shift clock pd4/ sck pd5/ ss slave spi spi master clock clock
non-disclosure agreement required serial peripheral interface (spi) advance information MC68HC05C9A ? rev. 5.0 96 serial peripheral interface (spi) motorola the spi is double buffered on read, but not on write. if a write is performed during data transfer, the transfer occurs uninterrupted, and the write will be unsuccessful. this condition will cause the write collision (wcol) status bit in the spsr to be set. after a data byte is shifted, the spif flag of the spsr is set. in the master mode, the sck pin is an output. it idles high or low, depending on the cpol bit in the spcr, until data is written to the shift register, at which point eight clocks are generated to shift the eight bits of data and then sck goes idle again. in a slave mode, the slave select start logic receives a logic low at the ss pin and a clock at the sck pin. thus, the slave is synchronized with the master. data from the master is received serially at the mosi line and loads the 8-bit shift register. after the 8-bit shift register is loaded, its data is parallel transferred to the read buffer. during a write cycle, data is written into the shift register, then the slave waits for a clock train from the master to shift the data out on the slave ? s miso line. figure 10-3 illustrates the mosi, miso, sck, and ss master-slave interconnections. figure 10-3. serial peripheral interface master-slave interconnection spi shift register 7 6 5 4 3 2 1 0 spi shift register 7 6 5 4 3 2 1 0 spdr ($000c) spdr ($000c) pd3/mosi pd2/miso pd5/ss pd4/sck master mcu slave mcu i/o port
serial peripheral interface (spi) spi registers MC68HC05C9A ? rev. 5.0 advance information motorola serial peripheral interface (spi) 97 non-disclosure agreement required 10.6 spi registers this subsection describes the three registers in the spi which provide control, status, and data storage functions. these registers are:  serial peripheral control register (spcr)  serial peripheral status register (spsr)  serial peripheral data i/o register (spdr) 10.6.1 serial peripheral control register the spi control register (spcr), shown in figure 10-4 , controls these functions:  enables spi interrupts  enables the spi system  selects between standard cmos or open drain outputs for port d  selects between master mode and slave mode  controls the clock/data relationship between master and slave  determines the idle level of the clock pin spie ? serial peripheral interrupt enable bit this read/write bit enables spi interrupts. reset clears the spie bit. 1 = spi interrupts enabled 0 = spi interrupts disabled address: $000a bit 7654321bit 0 read: spie spe dwom mstr cpol cpha spr1 spr0 write: reset:000001uu u = undetermined figure 10-4. spi control register (spcr)
non-disclosure agreement required serial peripheral interface (spi) advance information MC68HC05C9A ? rev. 5.0 98 serial peripheral interface (spi) motorola spe ? serial peripheral system enable bit this read/write bit enables the spi. reset clears the spe bit. 1 = spi system enabled 0 = spi system disabled dwom ? port d wire-or mode option bit this read/write bit disables the high side driver transistors on port d outputs so that port d outputs become open-drain drivers. dwom affects all seven port d pins together. 1 = port d outputs act as open-drain outputs. 0 = port d outputs are normal cmos outputs. mstr ? master mode select bit this read/write bit selects master mode operation or slave mode operation. reset clears the mstr bit. 1 = master mode 0 = slave mode cpol ? clock polarity bit when the clock polarity bit is cleared and data is not being transferred, a steady state low value is produced at the sck pin of the master device. conversely, if this bit is set, the sck pin will idle high. this bit is also used in conjunction with the clock phase control bit to produce the desired clock-data relationship between master and slave. see figure 10-1 . cpha ? clock phase bit the clock phase bit, in conjunction with the cpol bit, controls the clock-data relationship between master and slave. the cpol bit can be thought of as simply inserting an inverter in series with the sck line. the cpha bit selects one of two fundamentally different clocking protocols. when cpha = 0, the shift clock is the or of sck with ss . as soon as ss goes low, the transaction begins and the first edge on sck invokes the first data sample. when cpha=1, the ss pin may be thought of as a simple output enable control. see figure 10-1 .
serial peripheral interface (spi) spi registers MC68HC05C9A ? rev. 5.0 advance information motorola serial peripheral interface (spi) 99 non-disclosure agreement required spr1 and spr0 ? spi clock rate select bits these read/write bits select one of four master mode serial clock rates, as shown in table 10-1 . they have no effect in slave mode. 10.6.2 serial peripheral status register the spi status register (spsr), shown in figure 10-5 , contains flags to signal these conditions:  spi transmission complete  write collision  mode fault spif ? spi transfer complete flag the serial peripheral data transfer flag bit is set upon completion of data transfer between the processor and external device. if spif goes high, and if spie is set, a serial peripheral interrupt is generated. clearing the spif bit is accomplished by reading the spsr (with table 10-1. spi clock rate selection spr1 and spr0 spi clock rate 0 0 internal clock 2 0 1 internal clock 4 1 0 internal clock 16 1 1 internal clock 32 address: $000b bit 7654321bit 0 read: spif wcol 0 modf 0000 write: reset:00000000 = unimplemented figure 10-5. spi status register
non-disclosure agreement required serial peripheral interface (spi) advance information MC68HC05C9A ? rev. 5.0 100 serial peripheral interface (spi) motorola spif set) followed by an access of the spdr. following the initial transfer, unless spsr is read (with spif set) first, attempts to write to spdr are inhibited. wcol ? write collision bit the write collision bit is set when an attempt is made to write to the serial peripheral data register while data transfer is taking place. if cpha is 0, a transfer is said to begin when ss goes low and the transfer ends when ss goes high after eight clock cycles on sck. when cpha is 1, a transfer is said to begin the first time sck becomes active while ss is low and the transfer ends when the spif flag gets set. clearing the wcol bit is accomplished by reading the spsr (with wcol set) followed by an access to spdr. modf ? mode fault flag the mode fault flag indicates that there may have been a multi-master conflict for system control and allows a proper exit from system operation to a reset or default system state. the modf bit is normally clear, and is set only when the master device has its ss pin pulled low. setting the modf bit affects the internal serial peripheral interface system in these ways: 1. an spi interrupt is generated if spie = 1. 2. the spe bit is cleared. this disables the spi. 3. the mstr bit is cleared, thus forcing the device into the slave mode. clearing the modf bit is accomplished by reading the spsr (with modf set), followed by a write to the spcr. control bits spe and mstr may be restored by user software to their original state during this clearing sequence or after the modf bit has been cleared. it is also necessary to restore ddrd after a mode fault. bits 5 and 3 ? 0 ? not implemented these bits always read 0.
serial peripheral interface (spi) spi registers MC68HC05C9A ? rev. 5.0 advance information motorola serial peripheral interface (spi) 101 non-disclosure agreement required 10.6.3 serial peripheral data i/o register the serial peripheral data i/o register (spdr), shown in figure 10-6 , is used to transmit and receive data on the serial bus. only a write to this register will initiate transmission/reception of another byte and this will only occur in the master device. at the completion of transmitting a byte of data, the spif status bit is set in both the master and slave devices. when the user reads the serial peripheral data i/o register, a buffer is actually being read. the first spif must be cleared by the time a second transfer of the data from the shift register to the read buffer is initiated or an overrun condition will exist. in cases of overrun, the byte which causes the overrun is lost. a write to the serial peripheral data i/o register is not buffered and places data directly into the shift register for transmission. address: $000c bit 7654321bit 0 read: spd7 spd6 spd5 spd4 spd3 spd2 spd1 spd0 write: reset: unaffected by reset figure 10-6. spi data register (spdr)
non-disclosure agreement required serial peripheral interface (spi) advance information MC68HC05C9A ? rev. 5.0 102 serial peripheral interface (spi) motorola
MC68HC05C9A ? rev. 5.0 advance information motorola instruction set 103 non-disclosure agreement required advance information ? MC68HC05C9A section 11. instruction set 11.1 contents 11.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .103 11.3 addressing modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .104 11.3.1 inherent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .104 11.3.2 immediate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .104 11.3.3 direct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .105 11.3.4 extended . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .105 11.3.5 indexed, no offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .105 11.3.6 indexed, 8-bit offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . .105 11.3.7 indexed, 16-bit offset . . . . . . . . . . . . . . . . . . . . . . . . . . . .106 11.3.8 relative . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 11.4 instruction types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .107 11.4.1 register/memory instructions . . . . . . . . . . . . . . . . . . . . . .107 11.4.2 read-modify-write instructions . . . . . . . . . . . . . . . . . . . . .108 11.4.3 jump/branch instructions . . . . . . . . . . . . . . . . . . . . . . . . .109 11.4.4 bit manipulation instructions . . . . . . . . . . . . . . . . . . . . . . .111 11.4.5 control instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .111 11.5 instruction set summary . . . . . . . . . . . . . . . . . . . . . . . . . . . .112 11.6 opcode map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .118 11.2 introduction the microcontroller unit (mcu) instruction set has 62 instructions and uses eight addressing modes. the instructions include all those of the m146805 cmos (complementary metal-oxide semiconductor) family plus one more: the unsigned multiply (mul) instruction. the mul instruction allows unsigned multiplication of the contents of the accumulator (a) and the index register (x). the high-order product is stored in the index register, and the low-order product is stored in the accumulator.
non-disclosure agreement required instruction set advance information MC68HC05C9A ? rev. 5.0 104 instruction set motorola 11.3 addressing modes the central processor unit (cpu) uses eight addressing modes for flexibility in accessing data. the addressing modes provide eight different ways for the cpu to find the data required to execute an instruction. the eight addressing modes are:  inherent  immediate  direct  extended  indexed, no offset  indexed, 8-bit offset  indexed, 16-bit offset  relative 11.3.1 inherent inherent instructions are those that have no operand, such as return from interrupt (rti) and stop (stop). some of the inherent instructions act on data in the cpu registers, such as set carry flag (sec) and increment accumulator (inca). inherent instructions require no operand address and are one byte long. 11.3.2 immediate immediate instructions are those that contain a value to be used in an operation with the value in the accumulator or index register. immediate instructions require no operand address and are two bytes long. the opcode is the first byte, and the immediate data value is the second byte.
instruction set addressing modes MC68HC05C9A ? rev. 5.0 advance information motorola instruction set 105 non-disclosure agreement required 11.3.3 direct direct instructions can access any of the first 256 memory locations with two bytes. the first byte is the opcode, and the second is the low byte of the operand address. in direct addressing, the cpu automatically uses $00 as the high byte of the operand address. 11.3.4 extended extended instructions use three bytes and can access any address in memory. the first byte is the opcode; the second and third bytes are the high and low bytes of the operand address. when using the motorola assembler, the programmer does not need to specify whether an instruction is direct or extended. the assembler automatically selects the shortest form of the instruction. 11.3.5 indexed, no offset indexed instructions with no offset are 1-byte instructions that can access data with variable addresses within the first 256 memory locations. the index register contains the low byte of the effective address of the operand. the cpu automatically uses $00 as the high byte, so these instructions can address locations $0000 ? $00ff. indexed, no offset instructions are often used to move a pointer through a table or to hold the address of a frequently used random-access memory (ram) or input/output (i/o) location. 11.3.6 indexed, 8-bit offset indexed, 8-bit offset instructions are 2-byte instructions that can access data with variable addresses within the first 511 memory locations. the cpu adds the unsigned byte in the index register to the unsigned byte following the opcode. the sum is the effective address of the operand. these instructions can access locations $0000 ? $01fe.
non-disclosure agreement required instruction set advance information MC68HC05C9A ? rev. 5.0 106 instruction set motorola indexed 8-bit offset instructions are useful for selecting the kth element in an n-element table. the table can begin anywhere within the first 256 memory locations and could extend as far as location 510 ($01fe). the k value is typically in the index register, and the address of the beginning of the table is in the byte following the opcode. 11.3.7 indexed, 16-bit offset indexed, 16-bit offset instructions are 3-byte instructions that can access data with variable addresses at any location in memory. the cpu adds the unsigned byte in the index register to the two unsigned bytes following the opcode. the sum is the effective address of the operand. the first byte after the opcode is the high byte of the 16-bit offset; the second byte is the low byte of the offset. indexed, 16-bit offset instructions are useful for selecting the kth element in an n-element table anywhere in memory. as with direct and extended addressing, the motorola assembler determines the shortest form of indexed addressing. 11.3.8 relative relative addressing is only for branch instructions. if the branch condition is true, the cpu finds the effective branch destination by adding the signed byte following the opcode to the contents of the program counter. if the branch condition is not true, the cpu goes to the next instruction. the offset is a signed, two ? s complement byte that gives a branching range of ? 128 to +127 bytes from the address of the next location after the branch instruction. when using the motorola assembler, the programmer does not need to calculate the offset, because the assembler determines the proper offset and verifies that it is within the span of the branch.
instruction set instruction types MC68HC05C9A ? rev. 5.0 advance information motorola instruction set 107 non-disclosure agreement required 11.4 instruction types the mcu instructions fall into these five categories:  register/memory instructions  read-modify-write instructions  jump/branch instructions  bit manipulation instructions  control instructions 11.4.1 register/memory instructions these instructions operate on central processor unit (cpu) registers and memory locations. most of them use two operands. one operand is in either the accumulator or the index register. the cpu finds the other operand in memory. table 11-1. register/memory instructions instruction mnemonic add memory byte and carry bit to accumulator adc add memory byte to accumulator add and memory byte with accumulator and bit test accumulator bit compare accumulator cmp compare index register with memory byte cpx exclusive or accumulator with memory byte eor load accumulator with memory byte lda load index register with memory byte ldx multiply mul or accumulator with memory byte ora subtract memory byte and carry bit from accumulator sbc store accumulator in memory sta store index register in memory stx subtract memory byte from accumulator sub
non-disclosure agreement required instruction set advance information MC68HC05C9A ? rev. 5.0 108 instruction set motorola 11.4.2 read-modify-write instructions these instructions read a memory location or a register, modify its contents, and write the modified value back to the memory location or to the register. note: do not use read-modify-write operations on write-only registers. table 11-2. read-modify-write instructions instruction mnemonic arithmetic shift left (same as lsl) asl arithmetic shift right asr bit clear bclr (1) 1. unlike other read-modify-write instructions, bclr and bset use only direct addressing. bit set bset (1) clear register clr complement (one ? s complement) com decrement dec increment inc logical shift left (same as asl) lsl logical shift right lsr negate (two ? s complement) neg rotate left through carry bit rol rotate right through carry bit ror test for negative or zero tst (2) 2. tst is an exception to the read-modify-write sequence be- cause it does not write a replacement value.
instruction set instruction types MC68HC05C9A ? rev. 5.0 advance information motorola instruction set 109 non-disclosure agreement required 11.4.3 jump/branch instructions jump instructions allow the cpu to interrupt the normal sequence of the program counter. the unconditional jump instruction (jmp) and the jump-to-subroutine instruction (jsr) have no register operand. branch instructions allow the cpu to interrupt the normal sequence of the program counter when a test condition is met. if the test condition is not met, the branch is not performed. the brclr and brset instructions cause a branch based on the state of any readable bit in the first 256 memory locations. these 3-byte instructions use a combination of direct addressing and relative addressing. the direct address of the byte to be tested is in the byte following the opcode. the third byte is the signed offset byte. the cpu finds the effective branch destination by adding the third byte to the program counter if the specified bit tests true. the bit to be tested and its condition (set or clear) is part of the opcode. the span of branching is from ? 128 to +127 from the address of the next location after the branch instruction. the cpu also transfers the tested bit to the carry/borrow bit of the condition code register.
non-disclosure agreement required instruction set advance information MC68HC05C9A ? rev. 5.0 110 instruction set motorola table 11-3. jump and branch instructions instruction mnemonic branch if carry bit clear bcc branch if carry bit set bcs branch if equal beq branch if half-carry bit clear bhcc branch if half-carry bit set bhcs branch if higher bhi branch if higher or same bhs branch if irq pin high bih branch if irq pin low bil branch if lower blo branch if lower or same bls branch if interrupt mask clear bmc branch if minus bmi branch if interrupt mask set bms branch if not equal bne branch if plus bpl branch always bra branch if bit clear brclr branch never brn branch if bit set brset branch to subroutine bsr unconditional jump jmp jump to subroutine jsr
instruction set instruction types MC68HC05C9A ? rev. 5.0 advance information motorola instruction set 111 non-disclosure agreement required 11.4.4 bit manipulation instructions the cpu can set or clear any writable bit in the first 256 bytes of memory, which includes i/o registers and on-chip ram locations. the cpu can also test and branch based on the state of any bit in any of the first 256 memory locations. 11.4.5 control instructions these instructions act on cpu registers and control cpu operation during program execution. table 11-4. bit manipulation instructions instruction mnemonic bit clear bclr branch if bit clear brclr branch if bit set brset bit set bset table 11-5. control instructions instruction mnemonic clear carry bit clc clear interrupt mask cli no operation nop reset stack pointer rsp return from interrupt rti return from subroutine rts set carry bit sec set interrupt mask sei stop oscillator and enable irq pin stop software interrupt swi transfer accumulator to index register tax transfer index register to accumulator txa stop cpu clock and enable interrupts wait
non-disclosure agreement required instruction set advance information MC68HC05C9A ? rev. 5.0 112 instruction set motorola 11.5 instruction set summary . table 11-6. instruction set summary (sheet 1 of 7) source form operation description effect on ccr address mode opcode operand cycles hinzc adc # opr adc opr adc opr adc opr ,x adc opr ,x adc ,x add with carry a (a) + (m) + (c) ? ? ??? imm dir ext ix2 ix1 ix a9 b9 c9 d9 e9 f9 ii dd hh ll ee ff ff 2 3 4 5 4 3 add # opr add opr add opr add opr ,x add opr ,x add ,x add without carry a (a) + (m) ? ? ??? imm dir ext ix2 ix1 ix ab bb cb db eb fb ii dd hh ll ee ff ff 2 3 4 5 4 3 and # opr and opr an d opr and opr ,x and opr ,x and ,x logical and a (a) (m) ?? ?? ? imm dir ext ix2 ix1 ix a4 b4 c4 d4 e4 f4 ii dd hh ll ee ff ff 2 3 4 5 4 3 asl opr asla aslx asl opr ,x asl ,x arithmetic shift left (same as lsl) ?? ??? dir inh inh ix1 ix 38 48 58 68 78 dd ff 5 3 3 6 5 asr opr asra asrx asr opr ,x asr ,x arithmetic shift right ?? ??? dir inh inh ix1 ix 37 47 57 67 77 dd ff 5 3 3 6 5 bcc rel branch if carry bit clear pc (pc) + 2 + rel ? c = 0 ????? rel 24 rr 3 bclr n opr clear bit n mn 0 ????? dir (b0) dir (b1) dir (b2) dir (b3) dir (b4) dir (b5) dir (b6) dir (b7) 11 13 15 17 19 1b 1d 1f dd dd dd dd dd dd dd dd 5 5 5 5 5 5 5 5 bcs rel branch if carry bit set (same as blo) pc (pc) + 2 + rel ? c = 1 ????? rel 25 rr 3 beq rel branch if equal pc (pc) + 2 + rel ? z = 1 ????? rel 27 rr 3 c b0 b7 0 b0 b7 c
instruction set instruction set summary MC68HC05C9A ? rev. 5.0 advance information motorola instruction set 113 non-disclosure agreement required bhcc rel branch if half-carry bit clear pc (pc) + 2 + rel ? h = 0 ????? rel 28 rr 3 bhcs rel branch if half-carry bit set pc (pc) + 2 + rel ? h = 1 ????? rel 29 rr 3 bhi rel branch if higher pc (pc) + 2 + rel ? c z = 0 ????? rel 22 rr 3 bhs rel branch if higher or same pc (pc) + 2 + rel ? c = 0 ????? rel 24 rr 3 bih rel branch if irq pin high pc (pc) + 2 + rel ? irq = 1 ????? rel 2f rr 3 bil rel branch if irq pin low pc (pc) + 2 + rel ? irq = 0 ????? rel 2e rr 3 bit # opr bit opr bit opr bit opr ,x bit opr ,x bit ,x bit test accumulator with memory byte (a) (m) ?? ?? ? imm dir ext ix2 ix1 ix a5 b5 c5 d5 e5 f5 ii dd hh ll ee ff ff p 2 3 4 5 4 3 blo rel branch if lower (same as bcs) pc (pc) + 2 + rel ? c = 1 ????? rel 25 rr 3 bls rel branch if lower or same pc (pc) + 2 + rel ? c z = 1 ????? rel 23 rr 3 bmc rel branch if interrupt mask clear pc (pc) + 2 + rel ? i = 0 ????? rel 2c rr 3 bmi rel branch if minus pc (pc) + 2 + rel ? n = 1 ????? rel 2b rr 3 bms rel branch if interrupt mask set pc (pc) + 2 + rel ? i = 1 ????? rel 2d rr 3 bne rel branch if not equal pc (pc) + 2 + rel ? z = 0 ????? rel 26 rr 3 bpl rel branch if plus pc (pc) + 2 + rel ? n = 0 ????? rel 2a rr 3 bra rel branch always pc (pc) + 2 + rel ? 1 = 1 ????? rel 20 rr 3 brclr n opr rel branch if bit n clear pc (pc) + 2 + rel ? mn = 0 ???? ? dir (b0) dir (b1) dir (b2) dir (b3) dir (b4) dir (b5) dir (b6) dir (b7) 01 03 05 07 09 0b 0d 0f dd rr dd rr dd rr dd rr dd rr dd rr dd rr dd rr 5 5 5 5 5 5 5 5 table 11-6. instruction set summary (sheet 2 of 7) source form operation description effect on ccr address mode opcode operand cycles hinzc
non-disclosure agreement required instruction set advance information MC68HC05C9A ? rev. 5.0 114 instruction set motorola brset n opr rel branch if bit n set pc (pc) + 2 + rel ? mn = 1 ???? ? dir (b0) dir (b1) dir (b2) dir (b3) dir (b4) dir (b5) dir (b6) dir (b7) 00 02 04 06 08 0a 0c 0e dd rr dd rr dd rr dd rr dd rr dd rr dd rr dd rr 5 5 5 5 5 5 5 5 brn rel branch never pc (pc) + 2 + rel ? 1 = 0 ????? rel 21 rr 3 bset n opr set bit n mn 1 ????? dir (b0) dir (b1) dir (b2) dir (b3) dir (b4) dir (b5) dir (b6) dir (b7) 10 12 14 16 18 1a 1c 1e dd dd dd dd dd dd dd dd 5 5 5 5 5 5 5 5 bsr rel branch to subroutine pc (pc) + 2; push (pcl) sp (sp) ? 1; push (pch) sp (sp) ? 1 pc (pc) + rel ????? rel ad rr 6 clc clear carry bit c 0 ???? 0inh98 2 cli clear interrupt mask i 0 ? 0 ??? inh 9a 2 clr opr clra clrx clr opr ,x clr ,x clear byte m $00 a $00 x $00 m $00 m $00 ?? 01 ? dir inh inh ix1 ix 3f 4f 5f 6f 7f dd ff 5 3 3 6 5 cmp # opr cmp opr cmp opr cmp opr ,x cmp opr ,x cmp ,x compare accumulator with memory byte (a) ? (m) ?? ??? imm dir ext ix2 ix1 ix a1 b1 c1 d1 e1 f1 ii dd hh ll ee ff ff 2 3 4 5 4 3 com opr coma comx com opr ,x com ,x complement byte (one ? s complement) m ( ) = $ff ? (m) a ( ) = $ff ? (m) x ( ) = $ff ? (m) m ( ) = $ff ? (m) m ( ) = $ff ? (m) ?? ?? 1 dir inh inh ix1 ix 33 43 53 63 73 dd ff 5 3 3 6 5 table 11-6. instruction set summary (sheet 3 of 7) source form operation description effect on ccr address mode opcode operand cycles hinzc m a x m m
instruction set instruction set summary MC68HC05C9A ? rev. 5.0 advance information motorola instruction set 115 non-disclosure agreement required cpx # opr cpx opr cpx opr cpx opr ,x cpx opr ,x cpx ,x compare index register with memory byte (x) ? (m) ?? ?? 1 imm dir ext ix2 ix1 ix a3 b3 c3 d3 e3 f3 ii dd hh ll ee ff ff 2 3 4 5 4 3 dec opr deca decx dec opr ,x dec ,x decrement byte m (m) ? 1 a (a) ? 1 x (x) ? 1 m (m) ? 1 m (m) ? 1 ?? ?? ? dir inh inh ix1 ix 3a 4a 5a 6a 7a dd ff 5 3 3 6 5 eor # opr eor opr eor opr eor opr ,x eor opr ,x eor ,x exclusive or accumulator with memory byte a (a) (m) ?? ?? ? imm dir ext ix2 ix1 ix a8 b8 c8 d8 e8 f8 ii dd hh ll ee ff ff 2 3 4 5 4 3 inc opr inca incx inc opr ,x inc ,x increment byte m (m) + 1 a (a) + 1 x (x) + 1 m (m) + 1 m (m) + 1 ?? ?? ? dir inh inh ix1 ix 3c 4c 5c 6c 7c dd ff 5 3 3 6 5 jmp opr jmp opr jmp opr ,x jmp opr ,x jmp ,x unconditional jump pc jump address ????? dir ext ix2 ix1 ix bc cc dc ec fc dd hh ll ee ff ff 2 3 4 3 2 jsr opr jsr opr jsr opr ,x jsr opr ,x jsr ,x jump to subroutine pc (pc) + n (n = 1, 2, or 3) push (pcl); sp (sp) ? 1 push (pch); sp (sp) ? 1 pc conditional address ????? dir ext ix2 ix1 ix bd cd dd ed fd dd hh ll ee ff ff 5 6 7 6 5 lda # opr lda opr lda opr lda opr ,x lda opr ,x lda ,x load accumulator with memory byte a (m) ?? ?? ? imm dir ext ix2 ix1 ix a6 b6 c6 d6 e6 f6 ii dd hh ll ee ff ff 2 3 4 5 4 3 table 11-6. instruction set summary (sheet 4 of 7) source form operation description effect on ccr address mode opcode operand cycles hinzc
non-disclosure agreement required instruction set advance information MC68HC05C9A ? rev. 5.0 116 instruction set motorola ldx # opr ldx opr ldx opr ldx opr ,x ldx opr ,x ldx ,x load index register with memory byte x (m) ?? ?? ? imm dir ext ix2 ix1 ix ae be ce de ee fe ii dd hh ll ee ff ff 2 3 4 5 4 3 lsl opr lsla lslx lsl opr ,x lsl ,x logical shift left (same as asl) ?? ??? dir inh inh ix1 ix 38 48 58 68 78 dd ff 5 3 3 6 5 lsr opr lsra lsrx lsr opr ,x lsr ,x logical shift right ?? 0 ?? dir inh inh ix1 ix 34 44 54 64 74 dd ff 5 3 3 6 5 mul unsigned multiply x : a (x) (a) 0 ??? 0 inh 42 11 neg opr nega negx neg opr ,x neg ,x negate byte (two ? s complement) m ? (m) = $00 ? (m) a ? (a) = $00 ? (a) x ? (x) = $00 ? (x) m ? (m) = $00 ? (m) m ? (m) = $00 ? (m) ?? ??? dir inh inh ix1 ix 30 40 50 60 70 ii ff 5 3 3 6 5 nop no operation ????? inh 9d 2 ora # opr ora opr ora opr ora opr ,x ora opr ,x ora ,x logical or accumulator with memory a (a) (m) ?? ?? ? imm dir ext ix2 ix1 ix aa ba ca da ea fa ii dd hh ll ee ff ff 2 3 4 5 4 3 rol opr rola rolx rol opr ,x rol ,x rotate byte left through carry bit ?? ??? dir inh inh ix1 ix 39 49 59 69 79 dd ff 5 3 3 6 5 ror opr rora rorx ror opr ,x ror ,x rotate byte right through carry bit ?? ??? dir inh inh ix1 ix 36 46 56 66 76 dd ff 5 3 3 6 5 rsp reset stack pointer sp $00ff ????? inh 9c 2 table 11-6. instruction set summary (sheet 5 of 7) source form operation description effect on ccr address mode opcode operand cycles hinzc c b0 b7 0 b0 b7 c 0 c b0 b7 b0 b7 c
instruction set instruction set summary MC68HC05C9A ? rev. 5.0 advance information motorola instruction set 117 non-disclosure agreement required rti return from interrupt sp (sp) + 1; pull (ccr) sp (sp) + 1; pull (a) sp (sp) + 1; pull (x) sp (sp) + 1; pull (pch) sp (sp) + 1; pull (pcl) ????? inh 80 6 rts return from subroutine sp (sp) + 1; pull (pch) sp (sp) + 1; pull (pcl) ????? inh sbc # opr sbc opr sbc opr sbc opr ,x sbc opr ,x sbc ,x subtract memory byte and carry bit from accumulator a (a) ? (m) ? (c) ?? ??? imm dir ext ix2 ix1 ix a2 b2 c2 d2 e2 f2 ii dd hh ll ee ff ff 2 3 4 5 4 3 sec set carry bit c 1 ???? 1inh99 2 sei set interrupt mask i 1 ? 1 ??? inh 9b 2 sta opr sta opr sta opr ,x sta opr ,x sta ,x store accumulator in memory m (a) ?? ?? ? dir ext ix2 ix1 ix b7 c7 d7 e7 f7 dd hh ll ee ff ff 4 5 6 5 4 stop stop oscillator and enable irq pin ? 0 ??? inh 8e 2 stx opr stx opr stx opr ,x stx opr ,x stx ,x store index register in memory m (x) ?? ?? ? dir ext ix2 ix1 ix bf cf df ef ff dd hh ll ee ff ff 4 5 6 5 4 sub # opr sub opr sub opr sub opr ,x sub opr ,x sub ,x subtract memory byte from accumulator a (a) ? (m) ?? ??? imm dir ext ix2 ix1 ix a0 b0 c0 d0 e0 f0 ii dd hh ll ee ff ff 2 3 4 5 4 3 swi software interrupt pc (pc) + 1; push (pcl) sp (sp) ? 1; push (pch) sp (sp) ? 1; push (x) sp (sp) ? 1; push (a) sp (sp) ? 1; push (ccr) sp (sp) ? 1; i 1 pch interrupt vector high byte pcl interrupt vector low byte ? 1 ??? inh 83 10 table 11-6. instruction set summary (sheet 6 of 7) source form operation description effect on ccr address mode opcode operand cycles hinzc
non-disclosure agreement required instruction set advance information MC68HC05C9A ? rev. 5.0 118 instruction set motorola 11.6 opcode map see table 11-7 . tax transfer accumulator to index register x (a) ????? inh 97 2 tst opr tsta tstx tst opr ,x tst ,x test memory byte for negative or zero (m) ? $00 ????? dir inh inh ix1 ix 3d 4d 5d 6d 7d dd ff 4 3 3 5 4 txa transfer index register to accumulator a (x) ????? inh 9f 2 wait stop cpu clock and enable interrupts ? ? ??? inh 8f 2 a accumulator opr operand (one or two bytes) c carry/borrow flag pc program counter ccr condition code register pch program counter high byte dd direct address of operand pcl program counter low byte dd rr direct address of operand and relative offset of branch instruction rel relative addressing mode dir direct addressing mode rel relative program counter offset byte ee ff high and low bytes of offset in indexed, 16-bit offset addressing rr relative program counter offset byte ext extended addressing mode sp stack pointer ff offset byte in indexed, 8-bit offset addressing x index register h half-carry flag z zero flag hh ll high and low bytes of operand address in extended addressing # immediate value i interrupt mask logical and ii immediate operand byte logical or imm immediate addressing mode logical exclusive or inh inherent addressing mode ( ) contents of ix indexed, no offset addressing mode ? ( ) negation (two ? s complement) ix1 indexed, 8-bit offset addressing mode loaded with ix2 indexed, 16-bit offset addressing mode ? if m memory location : concatenated with n negative flag ? set or cleared n any bit ? not affected table 11-6. instruction set summary (sheet 7 of 7) source form operation description effect on ccr address mode opcode operand cycles hinzc
MC68HC05C9A ? rev. 5.0 advance information motorola instruction set 119 instruction set opcode map non-disclosure agreement required table 11-7. opcode map bit manipulation branch read-modify-write control register/memory dir dir rel dir inh inh ix1 ix inh inh imm dir ext ix2 ix1 ix 0123456789abcdef 0 5 brset0 3dir 5 bset0 2dir 3 bra 2rel 5 neg 2dir 3 nega 1inh 3 negx 1inh 6 neg 2ix1 5 neg 1ix 9 rti 1inh 2 sub 2imm 3 sub 2dir 4 sub 3ext 5 sub 3ix2 4 sub 2ix1 3 sub 1ix 0 1 5 brclr0 3dir 5 bclr0 2dir 3 brn 2rel 6 rts 1inh 2 cmp 2imm 3 cmp 2dir 4 cmp 3ext 5 cmp 3ix2 4 cmp 2ix1 3 cmp 1ix 1 2 5 brset1 3dir 5 bset1 2dir 3 bhi 2rel 11 mul 1inh 2 sbc 2imm 3 sbc 2dir 4 sbc 3ext 5 sbc 3ix2 4 sbc 2ix1 3 sbc 1ix 2 3 5 brclr1 3dir 5 bclr1 2dir 3 bls 2rel 5 com 2dir 3 coma 1inh 3 comx 1inh 6 com 2ix1 5 com 1ix 10 swi 1inh 2 cpx 2imm 3 cpx 2dir 4 cpx 3ext 5 cpx 3ix2 4 cpx 2ix1 3 cpx 1ix 3 4 5 brset2 3dir 5 bset2 2dir 3 bcc 2rel 5 lsr 2dir 3 lsra 1inh 3 lsrx 1inh 6 lsr 2ix1 5 lsr 1ix 2 and 2imm 3 and 2dir 4 and 3ext 5 and 3ix2 4 and 2ix1 3 and 1ix 4 5 5 brclr2 3dir 5 bclr2 2dir 3 bcs/blo 2rel 2 bit 2imm 3 bit 2dir 4 bit 3ext 5 bit 3ix2 4 bit 2ix1 3 bit 1ix 5 6 5 brset3 3dir 5 bset3 2dir 3 bne 2rel 5 ror 2dir 3 rora 1inh 3 rorx 1inh 6 ror 2ix1 5 ror 1ix 2 lda 2imm 3 lda 2dir 4 lda 3ext 5 lda 3ix2 4 lda 2ix1 3 lda 1ix 6 7 5 brclr3 3dir 5 bclr3 2dir 3 beq 2rel 5 asr 2dir 3 asra 1inh 3 asrx 1inh 6 asr 2ix1 5 asr 1ix 2 tax 1inh 4 sta 2dir 5 sta 3ext 6 sta 3ix2 5 sta 2ix1 4 sta 1ix 7 8 5 brset4 3dir 5 bset4 2dir 3 bhcc 2rel 5 asl/lsl 2dir 3 asla/lsla 1inh 3 aslx/lslx 1inh 6 asl/lsl 2ix1 5 asl/lsl 1ix 2 clc 1inh 2 eor 2imm 3 eor 2dir 4 eor 3ext 5 eor 3ix2 4 eor 2ix1 3 eor 1ix 8 9 5 brclr4 3dir 5 bclr4 2dir 3 bhcs 2rel 5 rol 2dir 3 rola 1inh 3 rolx 1inh 6 rol 2ix1 5 rol 1ix 2 sec 1inh 2 adc 2imm 3 adc 2dir 4 adc 3ext 5 adc 3ix2 4 adc 2ix1 3 adc 1ix 9 a 5 brset5 3dir 5 bset5 2dir 3 bpl 2rel 5 dec 2dir 3 deca 1inh 3 decx 1inh 6 dec 2ix1 5 dec 1ix 2 cli 1inh 2 ora 2imm 3 ora 2dir 4 ora 3ext 5 ora 3ix2 4 ora 2ix1 3 ora 1ix a b 5 brclr5 3dir 5 bclr5 2dir 3 bmi 2rel 2 sei 1inh 2 add 2imm 3 add 2dir 4 add 3ext 5 add 3ix2 4 add 2ix1 3 add 1ix b c 5 brset6 3dir 5 bset6 2dir 3 bmc 2rel 5 inc 2dir 3 inca 1inh 3 incx 1inh 6 inc 2ix1 5 inc 1ix 2 rsp 1inh 2 jmp 2dir 3 jmp 3ext 4 jmp 3ix2 3 jmp 2ix1 2 jmp 1ix c d 5 brclr6 3dir 5 bclr6 2dir 3 bms 2rel 4 tst 2dir 3 tsta 1inh 3 tstx 1inh 5 tst 2ix1 4 tst 1ix 2 nop 1inh 6 bsr 2rel 5 jsr 2dir 6 jsr 3ext 7 jsr 3ix2 6 jsr 2ix1 5 jsr 1ix d e 5 brset7 3dir 5 bset7 2dir 3 bil 2rel 2 stop 1inh 2 ldx 2imm 3 ldx 2dir 4 ldx 3ext 5 ldx 3ix2 4 ldx 2ix1 3 ldx 1ix e f 5 brclr7 3dir 5 bclr7 2dir 3 bih 2rel 5 clr 2dir 3 clra 1inh 3 clrx 1inh 6 clr 2ix1 5 clr 1ix 2 wait 1inh 2 txa 1inh 4 stx 2dir 5 stx 3ext 6 stx 3ix2 5 stx 2ix1 4 stx 1ix f inh = inherent rel = relative imm = immediate ix = indexed, no offset dir = direct ix1 = indexed, 8-bit offset ext = extended ix2 = indexed, 16-bit offset 0 msb of opcode in hexadecimal lsb of opcode in hexadecimal 0 5 brset0 3dir number of cycles opcode mnemonic number of bytes/addressing mode lsb msb lsb msb lsb msb
non-disclosure agreement required instruction set advance information MC68HC05C9A ? rev. 5.0 120 instruction set motorola
MC68HC05C9A ? rev. 5.0 advance information motorola electrical specifications 121 non-disclosure agreement required advance information ? MC68HC05C9A section 12. electrical specifications 12.1 contents 12.2 maximum ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .122 12.3 operating temperature . . . . . . . . . . . . . . . . . . . . . . . . . . . . .123 12.4 thermal characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . .123 12.5 power considerations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .124 12.6 5.0-volt dc electrical characteristics. . . . . . . . . . . . . . . . . . .125 12.7 3.3-volt dc electrical characteristics. . . . . . . . . . . . . . . . . . .126 12.8 5.0-volt control timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .128 12.9 3.3-volt control timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .129 12.10 5.0-volt serial peripheral interface timing . . . . . . . . . . . . . . .132 12.11 3.3-volt serial peripheral interface timing . . . . . . . . . . . . . . .133
non-disclosure agreement required electrical specifications advance information MC68HC05C9A ? rev. 5.0 122 electrical specifications motorola 12.2 maximum ratings maximum ratings are the extreme limits to which the microcontroller unit (mcu) can be exposed without permanently damaging it. the mcu contains circuitry to protect the inputs against damage from high static voltages; however, do not apply voltages higher than those shown in the table here. keep v in and v out within the range v ss (v in or v out ) v dd . connect unused inputs to the appropriate voltage level, either v ss or v dd . note: this device is not guaranteed to operate properly at the maximum ratings. refer to 12.6 5.0-volt dc electrical characteristics for guaranteed operating conditions. rating symbol value unit supply voltage v dd ? 0.3 to +7.0 v input voltage normal operation self-check mode (irq pin only) v in v tst v ss ? 0.3 to v dd + 0.3 v ss ? 0.3 to 2 x v dd + 0.3 v current drain per pin (excluding v dd and v ss ) i25ma storage temperature range t stg ? 65 to +150 c
electrical specifications operating temperature MC68HC05C9A ? rev. 5.0 advance information motorola electrical specifications 123 non-disclosure agreement required 12.3 operating temperature 12.4 thermal characteristics figure 12-1. test load characteristic symbol value unit operating temperature range MC68HC05C9Ap, fn, b, fb MC68HC05C9Amp, mfn, mb, mfb t a t l to t h 0 to +70 ? 40 to +125 c characteristic symbol value unit thermal resistance plastic dual in-line (pdip) ja 60 c/w thermal resistance plastic-leaded chip carrier (plcc) ja 70 c/w thermal resistance quad flat pack (qfp) ja 95 c/w thermal resistance plastic shrink dip (sdip) ja 60 c/w v dd = 4.5 v pins r1 r2 c pa 7 ? pa 0 pb7 ? pb0 pc7 ? pc0 pd5 ? pd0, pd7 3.26 ? 2.38 ? 50 pf v dd = 3.0 v pins r1 r2 c pa 7 ? pa 0 pb7 ? pb0 pc7 ? pc0 pd5 ? pd0, pd7 10.91 ? 6.32 ? 50 pf v dd c r2 r1 test point see table see table see table
non-disclosure agreement required electrical specifications advance information MC68HC05C9A ? rev. 5.0 124 electrical specifications motorola 12.5 power considerations the average chip-junction temperature, t j , in c, can be obtained from: t j = t a + (p d ja ) (1) where: t a = ambient temperature, c ja = package thermal resistance, junction to ambient, c/w p d = p int + p i/o p int = i dd v dd watts (chip internal power) p i/o = power dissipation on input and output pins (user determined) for most applications, p i/o ? p int and can be neglected. the following is an approximate relationship between p d and t j (neglecting p j ): p d = k (t j + 273 c) (2) solving equations (1) and (2) for k gives: k = p d (t a + 273 c) + ja (p d ) 2 (3) where k is a constant pertaining to the particular part. k can be determined from equation (3) by measuring p d (at equilibrium) for a known t a . using this value of k, the values of p d and t j can be obtained by solving equations (1) and (2) iteratively for any value of t a .
electrical specifications 5.0-volt dc electrical characteristics MC68HC05C9A ? rev. 5.0 advance information motorola electrical specifications 125 non-disclosure agreement required 12.6 5.0-volt dc electrical characteristics characteristic (1) (2) symbol min typ max unit output voltage i load = 10.0 a i load = ? 10.0 a v ol v oh ? v dd ? 0.1 ? ? 0.1 ? v output high voltage (i load = ? 0.8 ma) pa7 ? pa0, pb7 ? pb0, pc6 ? pc0, tcmp, pd7, pd0 (i load = ? 1.6 ma) pd5 ? pd1 (i load = ? 5.0 ma) pc7 v oh v dd ? 0.8 v dd ? 0.8 v dd ? 0.8 ? ? ? ? ? ? v output low voltage (i load = 1.6 ma) pa7 ? pa0, pb7 ? pb0, pc6 ? pc0, pd7, pd5 ? pd0, tcmp (i load = 10 ma) pc7 v ol ? ? ? ? 0.4 0.4 v input high voltage pa7 ? pa0, pb7 ? pb0, pc7 ? pc0, pd7, pd5 ? pd0, tcap, irq , reset , osc1 v ih 0.7 v dd ? v dd v input low voltage pa7 ? pa0, pb7 ? pb0, pc7 ? pc0, pd7, pd5 ? pd0, tcap, irq , reset , osc1 v il v ss ? 0.2 v dd v supply current (4.5 ? 5.5 vdc @ f op = 2.1 mhz) run (3) wait (4) stop (5) 25 c 0 to 70 c ? 40 to +125 c i dd ? ? ? ? ? 3.5 1.0 1.0 2.0 7.0 5.25 3.25 20.0 40.0 50.0 ma ma a a a i/o ports hi-z leakage current pa7 ? pa0, pb7 ? pb0 (without pullup) pc7 ? pc0, pd7, pd5 ? pd0 i oz ? 1.0 10 a input current reset , irq , osc1, tcap, pd7, pd5 ? pd0 i in ? 0.5 1 a input pullup current (6) pb7 ? pb0 (with pullup) i in 5 ? 60 a capacitance ports (as input or output) reset , irq , osc1, tcap, pd7, pd5, pd0 c out c in ? ? ? ? 12 8 pf 1. v dd = 5.0 vdc 10%, v ss = 0 vdc, t a = ? 40 to +125 c, unless otherwise noted 2. typical values reflect measurements taken on average processed devices at the midpoint of voltage range, 25 c only. 3. run (operating) i dd measured using external square wave clock source; all i/o pins configured as inputs, port b = v dd , all other inputs v il = 0.2 v, v ih = v dd ? 0.2 v; no dc loads; less than 50 pf on all outputs; c l = 20 pf on osc2 4. wait i dd measured using external square wave clock source; all i/o pins configured as inputs, port b = v dd , all other inputs v il = 0.2 v, v ih = v dd ? 0.2 v; no dc loads; less than 50 pf on all outputs; c l = 20 pf on osc2. wait i dd is affected linearly by the osc2 capacitance. 5. stop i dd measured with osc1 = 0.2 v; all i/o pins configured as inputs, port b = v dd , all other inputs v il = 0.2 v, v ih = v dd ? 0.2 v 6. input pullup current measured with v il = 0.2 v
non-disclosure agreement required electrical specifications advance information MC68HC05C9A ? rev. 5.0 126 electrical specifications motorola 12.7 3.3-volt dc electrical characteristics characteristic (1) (2) symbol min typ max unit output voltage i load = 10.0 a i load = ? 10.0 a v ol v oh ? v dd ? 0.1 ? ? 0.1 ? v output high voltage (i load = ? 0.2 ma) pa7 ? pa0, pb7 ? pb0, pc6 ? pc0, tcmp, pd7, pd0 (i load = ? 0.4 ma) pd5 ? pd1 (i load = ? 1.5 ma) pc7 v oh v dd ? 0.3 v dd ? 0.3 v dd ? 0.3 ? ? ? ? ? ? v output low voltage (i load = 0.4 ma) pa7 ? pa0, pb7 ? pb0, pc6 ? pc0, pd7, pd5 ? pd0, tcmp (i load = 6 ma) pc7 v ol ? ? ? ? 0.3 0.3 v input high voltage pa7 ? pa0, pb7 ? pb0, pc7 ? pc0, pd7, pd5 ? pd0, tcap, irq , reset , osc1 v ih 0.7 v dd ? v dd v input low voltage pa7 ? pa0, pb7 ? pb0, pc7 ? pc0, pd7, pd5 ? pd0, tcap, irq , reset , osc1 v il v ss ? 0.2 v dd v supply current (3.0 ? 3.6 vdc @ f op = 1.0 mhz) run (3) wait (4) stop (5) 25 c 0 to 70 c ? 40 to +125 c i dd ? ? ? ? ? 1.0 500 1.0 1.0 2.5 1.6 900 8 16 20 ma a a a a i/o ports hi-z leakage current pa7 ? pa0, pb7 ? pb0 (without pullup) pc7 ? pc0, pd7, pd5 ? pd0 i oz ? 1.0 10 a input current reset , irq , osc1, tcap, pd7, pd5 ? pd0 i in ? 0.5 1 a input pullup current (6) pb7 ? pb0 (with pullup) i in 0.5 ? 20 a capacitance ports (as input or output) reset , irq , osc1, tcap, pd7, pd5, pd0 c out c in ? ? ? ? 12 8 pf 1. v dd = 3.3 vdc 0.3 vdc, v ss = 0 vdc, t a = ? 40 to +125 c, unless otherwise noted 2. typical values reflect measurements taken on average processed devices at the midpoint of voltage range, 25 c only. 3. run (operating) i dd measured using external square wave clock source; all i/o pins configured as inputs, port b = v dd , all other inputs v il = 0.2 v, v ih = v dd ? 0.2 v; no dc loads; less than 50 pf on all outputs; c l = 20 pf on osc2 4. wait i dd measured using external square wave clock source; all i/o pins configured as inputs, port b = v dd , all other inputs v il = 0.2 v, v ih = v dd ? 0.2 v; no dc loads; less than 50 pf on all outputs; c l = 20 pf on osc2. wait i dd is affected linearly by the osc2 capacitance. 5. stop i dd measured with osc1 = 0.2 v; all i/o pins configured as inputs, port b = v dd , all other inputs v il = 0.2 v, v ih = v dd ? 0.2 v 6. input pullup current measured with v il = 0.2 v
electrical specifications 3.3-volt dc electrical characteristics MC68HC05C9A ? rev. 5.0 advance information motorola electrical specifications 127 non-disclosure agreement required figure 12-2. maximum supply current versus internal clock frequency, v dd = 5.5 v figure 12-3. maximum supply current versus internal clock frequency, v dd = 3.6 v 1.00 ma 2.00 ma 3.00 ma 4.00 ma 5.00 ma 1.5 mhz 2.0 mhz 0.5 mhz 1.0 mhz internal clock frequency (xtal 2) supply current (i dd ) 50 ma stop i dd w a i t i d d r u n ( o p e r a t i n g ) i d d v dd = 5.5 v t = ? 40 to 85 500 ma 1.00 ma 1.50 ma 0.5 mhz 1.0 mhz supply current (i dd ) w a i t i d d r u n ( o p e r a t i n g ) i d d v dd = 3.6 v t = ? 40 to 85 stop i dd
non-disclosure agreement required electrical specifications advance information MC68HC05C9A ? rev. 5.0 128 electrical specifications motorola 12.8 5.0-volt control timing characteristic (1) symbol min max unit frequency of operation crystal external clock f osc ? dc 4.2 4.2 mhz internal operating frequency (f osc 2) crystal external clock f op ? dc 2.1 2.1 mhz cycle time t cyc 480 ? ns crystal oscillator startup time t oxov ? 100 ms stop recovery startup time (crystal oscillator) t ilch ? 100 ms reset pulse width t rl 1.5 ? t cyc timer resolution (2) input capture pulse width input capture pulse period t resl t th , t tl t tltl 4.0 125 (3) ? ? ? t cyc ns t cyc interrupt pulse width low (edge-triggered) t ilih 125 ? ns interrupt pulse period t ilil (4) ? t cyc osc1 pulse width t oh , t ol 90 ? ns 1. v dd = 5.0 vdc 10%, v ss = 0 vdc, t a = ? 40 to +125 c, unless otherwise noted 2. because a 2-bit prescaler in the timer must count four internal cycles (t cyc ), this is the limiting minimum factor in determining the timer resolution. 3. the minimum period t tltl should not be less than the number of cycle times it takes to execute the capture interrupt service routine plus 24 t cyc . 4. the minimum t ilil should not be less than the number of cycle times it takes to execute the interrupt service routine plus 19 t cyc .
electrical specifications 3.3-volt control timing MC68HC05C9A ? rev. 5.0 advance information motorola electrical specifications 129 non-disclosure agreement required 12.9 3.3-volt control timing figure 12-4. tcap timing relationships characteristic (1) symbol min max unit frequency of operation crystal external clock f osc ? dc 2.0 2.0 mhz internal operating frequency (f osc 2) crystal external clock f op ? dc 1.0 1.0 mhz cycle time t cyc 1000 ? ns crystal oscillator start-up time t oxov ? 100 ms stop recovery start-up time (crystal oscillator) t ilch ? 100 ms reset pulse width t rl 1.5 ? t cyc timer resolution (2) input capture pulse width input capture pulse period t resl t th , t tl t tltl 4.0 125 (3) ? ? ? t cyc ns t cyc interrupt pulse width low (edge-triggered) t ilih 250 ? ns interrupt pulse period t ilil (4) ? t cyc osc1 pulse width t oh , t ol 200 ? ns 1. v dd = 3.3 vdc 0.3 vdc, v ss = 0 vdc, t a = ? 40 to +125 c, unless otherwise noted 2. because a 2-bit prescaler in the timer must count four internal cycles (t cyc ), this is the limiting minimum factor in determining the timer resolution. 3. the minimum period t tltl should not be less than the number of cycle times it takes to execute the capture interrupt service routine plus 24 t cyc . 4. the minimum t ilil should not be less than the number of cycle times it takes to execute the interrupt service routine plus 19 t cyc . t tltl (1) tcap pin t th (1) t tl (1) 1. refer to timer resolution data in 12.8 5.0-volt control timing and 12.9 3.3-volt control timing .
non-disclosure agreement required electrical specifications advance information MC68HC05C9A ? rev. 5.0 130 electrical specifications motorola figure 12-5. external interrupt timing figure 12-6. stop recovery timing diagram irq t ilih t ilil t ilih irq pin irq 1 irq n . . . a. edge-sensitive trigger condition . the minimum pulse width (t ilih ) is either 125 ns (f op = 2.1 mhz) or 250 ns (f op = 1 mhz). the period t ilil should not be less than the number of t cyc cycles it takes to execute the interrupt service routine plus 19 t cyc cycles. b. level-sensitive trigger condition . if after servicing an interrupt the irq remains low, (internal) normally used with wired-or connection the next interrupt is recognized. t ilih 4064 t cyc osc (1) t rl reset irq (2) irq (3) internal clock notes: 1. represents the internal clocking of the osc1 pin 2. irq pin edge-sensitive mask option 3. irq pin level- and edge-sensitive mask option 4. reset vector address shown for timing example reset or interrupt vector fetch $3ffe $3ffe $3ffe $3ffe $3ffe $3fff4
electrical specifications 3.3-volt control timing MC68HC05C9A ? rev. 5.0 advance information motorola electrical specifications 131 non-disclosure agreement required figure 12-7. power-on reset timing diagram figure 12-8. external reset timing $3ffe 4064 t cyc v dd osc1 pin (2) internal clock (3) internal data bus (3) $3ffe $3ffe $3ffe $3ffe $3ffe $3fff note 1 1. power-on reset threshold is typically between 1 v and 2 v. 3. internal clock, internal address bus, and internal data bus are not available externally. new pch new pcl 2. osc1 line is meant to represent time only, not frequency. 4. reset outputs v ol during 4064 por cycles. notes: reset pin note 4 internal address bus (3) internal clock (1) internal address bus (1) notes: internal data bus (1) $3ffe $3ffe $3fff new pc 1. internal clock, internal address bus, and internal data bus are not available externally. 2. the next rising edge of the internal clock after the rising edge of reset initiates the reset sequence. new pch t rl new pcl op code reset (2) $3ffe $3ffe
non-disclosure agreement required electrical specifications advance information MC68HC05C9A ? rev. 5.0 132 electrical specifications motorola 12.10 5.0-volt serial peripheral interface timing no. characteristic (1) symbol min max unit operating frequency master slave f op(m) f op(s) dc dc 0.5 2.1 f op mhz 1 cycle time master slave t cyc(m) t cyc(s) 2.0 480 ? ? t cyc ns 2 enable lead time master slave t lead(m) t lead(s) note (2) 240 ? ? ns 3 enable lag time master slave t lag(m) t lag(s) note (2) 720 ? ? ns 4 clock (sck) high time master slave t w(sckh)m t w(sckh)s 340 190 ? ? ns 5 clock (sck) low time master slave t w(sckl)m t w(sckl)s 340 190 ? ? ns 6 data setup time (inputs) master slave t su(m) t su(s) 100 100 ? ? ns 7 data hold time (inputs) master slave t h(m) t h(s) 100 100 ? ? ns 8 slave access time (time to data active from high-impedance state) t a 0 120 ns 9 slave disable time (hold time to high-impedance state) t dis ? 240 ns 10 data valid master (before capture edge) slave (after enable edge) (3) t v(m) t v(s) 0.25 ? ? 240 t cyc(m) ns 11 data hold time (outputs) master (after capture edge) slave (after enable edge) t ho(m) t ho(s) 0.25 0 ? ? t cyc(m) ns 12 rise time (20% v dd to 70% v dd , c l = 200 pf) spi outputs (sck, mosi, and miso) spi inputs (sck, mosi, miso, and ss ) t rm t rs ? ? 100 2.0 ns s 13 fall time (70% v dd to 20% v dd , c l = 200 pf) spi outputs (sck, mosi, and miso) spi inputs (sck, mosi, miso, and ss ) t fm t fs ? ? 100 2.0 ns s 1. v dd = 5.0 vdc 10%; v ss = 0 vdc, t a = ? 40 to +125 c, unless otherwise noted. refer to figure 12-9 and figure 12-10 for timing diagrams. 2. signal production depends on software. 3. assumes 200 pf load on all spi pins
electrical specifications 3.3-volt serial peripheral interface timing MC68HC05C9A ? rev. 5.0 advance information motorola electrical specifications 133 non-disclosure agreement required 12.11 3.3-volt serial peripheral interface timing no. characteristic (1) symbol min max unit operating frequency master slave f op(m) f op(s) dc dc 0.5 1.0 f op mhz 1 cycle time master slave t cyc(m) t cyc(s) 2.0 1.0 ? ? t cyc ns 2 enable lead time master slave t lead(m) t lead(s) note 2 500 ? ? ns 3 enable lag time master slave t lag(m) t lag(s) note 2 1.5 ? ? ns 4 clock (sck) high time master slave t w(sckh)m t w(sckh)s 720 400 ? ? ns 5 clock (sck) low time master slave t w(sckl)m t w(sckl)s 720 400 ? ? ns 6 data setup time (inputs) master slave t su(m) t su(s) 200 200 ? ? ns 7 data hold time (inputs) master slave t h(m) t h(s) 200 200 ? ? ns 8 slave access time (time to data active from high-impedance state) t a 0 250 ns 9 slave disable time (hold time to high-impedance state) t dis ? 500 ns 10 data valid master (before capture edge) slave (after enable edge) (3) t v(m) t v(s) 0.25 ? ? 500 t cyc(m) ns 11 data hold time (outputs) master (after capture edge) slave (after enable edge) t ho(m) t ho(s) 0.25 0 ? ? t cyc(m) ns 12 rise time (20% v dd to 70% v dd , c l = 200 pf) spi outputs (sck, mosi, and miso) spi inputs (sck, mosi, miso, and ss ) t rm t rs ? ? 200 2.0 ns s 13 fall time (70% v dd to 20% v dd , c l = 200 pf) spi outputs (sck, mosi, and miso) spi inputs (sck, mosi, miso, and ss ) t fm t fs ? ? 200 2.0 ns s 1. v dd = 3.3 vdc 0.3 vdc; v ss = 0 vdc, t a = ? 40 to +125 c, unless otherwise noted. refer to figure 12-9 and figure 12-10 for timing diagrams. 2. signal production depends on software. 3. assumes 200 pf load on all spi pins
non-disclosure agreement required electrical specifications advance information MC68HC05C9A ? rev. 5.0 134 electrical specifications motorola figure 12-9. spi master timing diagram note ss pin of master held high. msb in ss input sck (cpol = 0) output sck (cpol = 1) output miso input mosi output note 4 5 5 1 13 12 4 12 13 bits 6 ? 1 lsb in master msb out bits 6 ? 1 master lsb out 10 (ref) 13 11 10 12 11 (ref) 7 6 note ss pin of master held high. msb in ss input sck (cpol = 0) output sck (cpol = 1) output miso input mosi output note 4 5 5 1 13 12 4 13 bits 6 ? 1 lsb in master msb out bits 6 ? 1 master lsb out 10 (ref) 13 11 10 12 11 7 6 12 a) spi master timing (cpha = 0) b) spi master timing (cpha = 1) 12 note: this first clock edge is generated internally, but is not seen at the sck pin. note: this last clock edge is generated internally, but is not seen at the sck pin.
electrical specifications 3.3-volt serial peripheral interface timing MC68HC05C9A ? rev. 5.0 advance information motorola electrical specifications 135 non-disclosure agreement required figure 12-10. spi slave timing diagram slave ss input sck (cpol = 0) input sck (cpol = 1) input miso input mosi output 4 5 5 1 13 12 4 13 msb in bits 6 ? 1 8 6 10 11 11 12 note slave lsb out 9 3 lsb in 2 7 bits 6 ? 1 msb out slave ss input sck (cpol = 0) input sck (cpol = 1) input miso output mosi input 4 5 5 1 13 12 4 13 msb in bits 6 ? 1 8 6 10 11 12 note slave lsb out 9 3 lsb in 2 7 bits 6 ? 1 msb out 10 a) spi slave timing (cpha = 0) a) spi slave timing (cpha = 1) note: not defined but normally msb of character just received note: not defined but normally lsb of character previously transmitted
non-disclosure agreement required electrical specifications advance information MC68HC05C9A ? rev. 5.0 136 electrical specifications motorola
MC68HC05C9A ? rev. 5.0 advance information motorola mechanical specifications 137 non-disclosure agreement required advance information ? MC68HC05C9A section 13. mechanical specifications 13.1 contents 13.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .137 13.3 40-pin plastic dual in-line (dip) package (case 711-03) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .138 13.4 42-pin plastic shrink dual in-line (sdip) package (case 858-01) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .138 13.5 44-lead plastic-leaded chip carrier (plcc) (case 777-02) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .139 13.6 44-lead quad flat pack (qfp) (case 824a-01) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .140 13.2 introduction this section describes the dimensions of the plastic dual in-line package (dip), plastic shrink dual in-line package (sdip), plastic-leaded chip carrier (plcc), and quad flat pack (qfp) mcu packages. package dimensions available at the time of this publication are provided in this section. to make sure that you have the latest case outline specifications, contact one of the following:  local motorola sales office  world wide web at http://www.mcu.motsps.com follow world wide web on-line instructions to retrieve the current mechanical specifications.
non-disclosure agreement required mechanical specifications advance information MC68HC05C9A ? rev. 5.0 138 mechanical specifications motorola 13.3 40-pin plastic dual in-line (dip) package (case 711-03) figure 13-1. 40-pin plastic dip package (case 711-03) 13.4 42-pin plastic shrink dual in-line (sdip) package (case 858-01) figure 13-2. 42-pin plastic sdip package (case 858-01) 120 40 21 b a c seating plane d f g h k n m j l dim min max min max inches millimeters a 51.69 52.45 2.035 2.065 b 13.72 14.22 0.540 0.560 c 3.94 5.08 0.155 0.200 d 0.36 0.56 0.014 0.022 f 1.02 1.52 0.040 0.060 g 2.54 bsc 0.100 bsc h 1.65 2.16 0.065 0.085 j 0.20 0.38 0.008 0.015 k 2.92 3.43 0.115 0.135 l 15.24 bsc 0.600 bsc m 1 n 0.51 1.02 0.020 0.040 notes: 1.position tolerance of leads (d), shall bewithin 0.25 (0.010) at maximum material conditions, in relation to seating plane and each other. 2.dimension l to center of leads when formed parallel. 3.dimension b does not include mold flash. 1 0 0                     
    
      
          -b- -a- c d 42 pl f k g n j 42 pl m      
          
  h l 
  
 
                                            !  "  !         #  !  $#  !   121 42 22   
 -t-
mechanical specifications 44-lead plastic-leaded chip carrier (plcc) (case 777-02) MC68HC05C9A ? rev. 5.0 advance information motorola mechanical specifications 139 non-disclosure agreement required 13.5 44-lead plastic-leaded chip carrier (plcc) (case 777-02) figure 13-3. 44-lead plcc (case 777-02) -n- -l- -m- d y d k v w 1 44 brk b z u x view d-d s l-m m 0.007(0.180) n s t s l-m m 0.007(0.180) n s t g1 s l-m s 0.010 (0.25) n s t k1 f h s l-m m 0.007(0.180) n s t z g g1 r a e j view s c s l-m m 0.007(0.180) n s t s l-m m 0.007(0.180) n s t 0.004 (0.10) -t- seating plane view s dim min max min max millimeters inches a 0.685 0.695 17.40 17.65 b 0.685 0.695 17.40 17.65 c 0.165 0.180 4.20 4.57 e 0.090 0.110 2.29 2.79 f 0.013 0.019 0.33 0.48 g 0.050 bsc 1.27 bsc h 0.026 0.032 0.66 0.81 j 0.020 0.51 k 0.025 0.64 r 0.650 0.656 16.51 16.66 u 0.650 0.656 16.51 16.66 v 0.042 0.048 1.07 1.21 w 0.042 0.048 1.07 1.21 x 0.042 0.056 1.07 1.42 y 0.020 0.50 z 2 10 g1 0.610 0.630 15.50 16.00 k1 0.040 1.02 s l-m s 0.010 (0.25) n s t s l-m m 0.007(0.180) n s t 2 10 notes: 1.datums -l-, -m-, and -n- are determined where top of lead sholders exits plastic body at mold parting line. 2.dimension g1, true position to be measured at datum -t-, seating plane. 3.dimension r and u do not include mold flash. allowable mold flash is 0.010 (0.25) per side. 4.dimensioning and tolerancing per ansi y14.5m, 1982. 5.controlling dimension: inch. 6.the package top may be smaller than the package bottom by up to 0.012 (0.300). dimensions r and u are deter- mined at the outermost extremes of the plastic body exclusive of the mold flash, tie bar burrs, gate burrs and interlead flash, but including any mismatch between the top and bottom of the plastic body. 7.diminsion h does not include dambar protrusion or intrusion. the dambar protusion(s) shall not cause the h diminsion to be greater than 0.037 (0.940140). the dambar intrusion(s) shall not cause the h diminision to smaller than 0.025 (0.635).
non-disclosure agreement required mechanical specifications advance information MC68HC05C9A ? rev. 5.0 140 mechanical specifications motorola 13.6 44-lead quad flat pack (qfp) (case 824a-01) figure 13-4. 44-lead qfp (case 824a-01)     
       !   !    !  !   l -d- bv a s m c h   
 -c- g m -h-   
 -a- l detail a 33 23 34 44 22 12 111 -b- e b b -a,b,d- -h- j k m w d f n r t q base metal x section b ? b detail a detail c   
         
               %                          

  % %  %       
 %                      
 

  % %  %                    #  & &     !     "    "     $          !      # && & &  &&     #  & &     '       &&        #  #  "  #            #        #  & &
      #   #  "    #        $ !       $#           " #    !    (     (      (  (    )  (  ) (  ) (   detail c
MC68HC05C9A ? rev. 5.0 advance information motorola ordering information 141 non-disclosure agreement required advance information ? MC68HC05C9A section 14. ordering information 14.1 contents 14.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .141 14.3 mc order numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .141 14.2 introduction this section contains ordering information for the available package types. 14.3 mc order numbers table 14-1 shows the mc order numbers for the available package types. table 14-1. mc order numbers package type temperature range order number 40-pin plastic dual in-line package (dip) 0 c to 70 c MC68HC05C9Ap ? 40 c to 125 c MC68HC05C9Amp 42-pin shrink dual in-line package (sdip) 0 c to 70 c MC68HC05C9Ab ? 40 c to 125 c MC68HC05C9Amb 44-lead plastic-leaded chip carrier (plcc) 0 c to 70 c MC68HC05C9Afn ? 40 c to 125 c MC68HC05C9Amfn 44-pin quad flat pack (qfp) 0 c to 70 c MC68HC05C9Afb ? 40 c to 125 c MC68HC05C9Amfb 1. p = plastic dual in-line package (pdip) 2. b = shrink dual in-line package (sdip) 3. fn = plastic-leaded chip carrier (plcc) 4. fb = quad flat pack (qfp)
non-disclosure agreement required ordering information advance information MC68HC05C9A ? rev. 5.0 142 ordering information motorola
MC68HC05C9A ? rev. 5.0 advance information motorola mc68hcl05c9a 143 non-disclosure agreement required advance information ? MC68HC05C9A appendix a. mc68hcl05c9a a.1 contents a.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .143 a.3 operating temperature . . . . . . . . . . . . . . . . . . . . . . . . . . . . .143 a.4 dc electrical characeristics . . . . . . . . . . . . . . . . . . . . . . . . . . 144 a.4.1 1.8 ? 2.4-volt low-power output voltage . . . . . . . . . . . . . .144 a.4.2 1.8 ? 2.4-volt input pullup current . . . . . . . . . . . . . . . . . . . .144 a.4.3 2.5 ? 3.6-volt low-power output voltage . . . . . . . . . . . . . .145 a.4.4 2.6 ? 3.6-volt input pullup current . . . . . . . . . . . . . . . . . . . .145 a.4.5 low-power supply current . . . . . . . . . . . . . . . . . . . . . . . .146 a.2 introduction appendix a describes the mc68hcl05c9a, a low-power version of the MC68HC05C9A. the technical data applying to the MC68HC05C9A applies to the mc68hcl05c9 with the exceptions given in this appendix. a.3 operating temperature the data shown here replaces the corresponding data in 12.3 operating temperature . rating symbol value unit operating temperature range mc68hcl05c9ap, fn, b, fb (1) 1. p = plastic dual in-line package (pdip) fn = plastic-leaded chip carrier (plcc) b = shrink dual in-line package (sdip) fb = quad flat pack (qfp) t a t l to t h 0 to +70 c
non-disclosure agreement required mc68hcl05c9a advance information MC68HC05C9A ? rev. 5.0 144 mc68hcl05c9a motorola a.4 dc electrical characeristics the data in 12.6 5.0-volt dc electrical characteristics and 12.7 3.3-volt dc electrical characteristics applies to the mc68hcl05c9a with the exceptions given here. a.4.1 1.8 ? 2.4-volt low-power output voltage a.4.2 1.8 ? 2.4-volt input pullup current characteristic (1) symbol min typ max unit output high voltage (i load = ? 0.1 ma) pa7 ? pa0, pb7 ? pb0, pc6 ? pc0, tcmp, pd7, pd0 (i load = ? 0.2 ma) pd5 ? pd1 (i load = ? 0.75 ma) pc7 v oh v dd ? 0.3 v dd ? 0.3 v dd ? 0.3 ? ? ? ? ? ? v output low voltage (i load = 0.2 ma) pa7 ? pa0, pb7 ? pb0, pc6 ? pc0, pd7, pd5 ? pd0, tcmp (i load = 2.0 ma) pc7 v ol ? ? ? ? 0.3 0.3 v 1. v dd = 1.8 ? 2.4 vdc characteristic (1) symbol min typ max unit input pullup current pb7 ? pb0 (with pullup) i in 0.45 1.5 6.5 a 1. v dd = 1.8 ? 2.4 vdc
mc68hcl05c9a dc electrical characeristics MC68HC05C9A ? rev. 5.0 advance information motorola mc68hcl05c9a 145 non-disclosure agreement required a.4.3 2.5 ? 3.6-volt low-power output voltage a.4.4 2.6 ? 3.6-volt input pullup current characteristic symbol min typ max unit output high voltage (1) (i load = ? 0.2 ma) pa7 ? pa0, pb7 ? pb0, pc6 ? pc0, tcmp, pd7, pd0 (i load = ? 0.4 ma) pd5 ? pd1 (i load = ? 1.5 ma) pc7 v oh v dd ? 0.3 v dd ? 0.3 v dd ? 0.3 ? ? ? ? ? ? v output low voltage (i load = 0.4 ma) pa7 ? pa0, pb7 ? pb0, pc6 ? pc0, pd7, pd5 ? pd0, tcmp (i load = 5.0 ma) pc7 v ol ? ? ? ? 0.3 0.3 v 1. v dd = 2.5 ? 3.6 vdc characteristic (1) symbol min typ max unit input pullup current pb7 ? pb0 (with pullup) i in 1516 a 1. v dd = 2.5 ? 3.6 vdc
non-disclosure agreement required mc68hcl05c9a advance information MC68HC05C9A ? rev. 5.0 146 mc68hcl05c9a motorola a.4.5 low-power supply current characteristic (1) symbol min typ max unit supply current (4.5 ? 5.5 vdc @ f bus = 2.1 mhz) run (2) wait (3) stop (4) 25 c 0 c to +70 c (standard) i dd ? ? ? ? 3.5 1.6 1 2 4.25 2.25 15 25 ma ma a a supply current (2.4 ? 3.6 vdc @ f bus = 1.0 mhz) run (2) wait (3) stop (4) 25 c 0 c to +70 c (standard) i dd ? ? ? ? 1.00 0.7 1 1 1.4 1.0 5 10 ma ma a a supply current (2.5 ? 3.6 vdc @ f bus = 500 khz) run (2) wait (3) stop (4) 25 c 0 c to +70 c (standard) i dd ? ? ? ? 500 300 1 1 750 500 5 10 a a a a supply current (1.8 ? 2.4 vdc @ f bus = 500 khz) run (2) wait (3) stop (4) 25 c 0 c to +70 c (standard) i dd ? ? ? ? 300 250 1 1 600 400 2 5 a a a a 1. typical values reflect measurements taken on average processed devices at the midpoint of voltage range, 25 c only. 2. run (operating) i dd measured using external square wave clock source; all i/o pins configured as inputs, port b = v dd , all other inputs v il = 0.2 v, v ih = v dd ? 0.2 v; no dc loads; less than 50 pf on all outputs; c l = 20 pf on osc2 3. wait i dd measured using external square wave clock source; all i/o pins configured as inputs, port b = v dd , all other inputs v il = 0.2 v, v ih = v dd ? 0.2 v; no dc loads; less than 50 pf on all outputs; c l = 20 pf on osc2. wait i dd is affected linearly by the osc2 capacitance. 4. stop i dd measured with osc1 = 0.2 v; all i/o pins configured as inputs, port b = v dd , all other inputs v il = 0.2 v, v ih = v dd ? 0.2 v
MC68HC05C9A ? rev. 5.0 advance information motorola mc68hsc05c9a 147 non-disclosure agreement required advance information ? MC68HC05C9A appendix b. mc68hsc05c9a b.1 contents b.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .147 b.3 operating temperature . . . . . . . . . . . . . . . . . . . . . . . . . . . . .148 b.4 dc electrical characeristics . . . . . . . . . . . . . . . . . . . . . . . . . . 149 b.4.1 high-speed supply current . . . . . . . . . . . . . . . . . . . . . . . .149 b.4.2 input pullup current . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .149 b.5 control timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .150 b.5.1 4.5 ? 5.5-volt high-speed control timing . . . . . . . . . . . . . .150 b.5.2 2.4 ? 3.6-volt high-speed control timing . . . . . . . . . . . . . .151 b.5.3 4.5 ? 5.5-volt high-speed control timing . . . . . . . . . . . . . .152 b.5.4 2.4 ? 3.6-volt high-speed spi timing . . . . . . . . . . . . . . . . .153 b.2 introduction appendix b describes the mc68hsc05c9a, a high-speed version of the MC68HC05C9A. the technical data applying to the MC68HC05C9A applies to the mc68hsc05c9a with the exceptions given in this appendix.
non-disclosure agreement required mc68hsc05c9a advance information MC68HC05C9A ? rev. 5.0 148 mc68hsc05c9a motorola b.3 operating temperature the data shown here replaces the corresponding data in 12.3 operating temperature . table b-1. high-speed operating temperature range rating symbol value unit operating temperature range (1) mc68hsc05c9ap, fn, b, fb mc68hsc05c9acp, cfn, cb, cfb 1. p = plastic dual in-line package (pdip) fn = plastic-leaded chip carrier (plcc) c = extended temperature range ( ? 40 c to +85 c) b = shrink dual in-line package (sdip) fb = quad flat pack (qfp) t a t l to t h 0 to +70 ? 40 to +85 c
mc68hsc05c9a dc electrical characeristics MC68HC05C9A ? rev. 5.0 advance information motorola mc68hsc05c9a 149 non-disclosure agreement required b.4 dc electrical characeristics the data in 12.6 5.0-volt dc electrical characteristics and 12.7 3.3-volt dc electrical characteristics applies to the mc68hsc05c9a with the exceptions given here. b.4.1 high-speed supply current b.4.2 input pullup current characteristic (1) symbol min typ max unit supply current (4.5 ? 5.5 vdc @ f bus = 4.0 mhz) run (2) wait (3) stop (4) 25 c 0 c to 70 c (standard) ? 40 c to 85 c (standard) i dd ? ? ? ? ? 7.00 2.00 1 1.0 7.0 11.0 6.50 20 40 50 ma ma a a a supply current (2.4 ? 3.6 vdc @ f bus = 2.0 mhz) run (2) wait (3) stop (4) 25 c 0 c to 70 c (standard) ? 40 c to 85 c (standard) i dd ? ? ? ? ? 2.50 1.00 1 1.0 2.5 4.00 2.00 8 16 20 ma ma a a a 1. typical values reflect measurements taken on average processed devices at the midpoint of voltage range, 25 c only. 2. run (operating) i dd measured using external square wave clock source; all i/o pins configured as inputs, port b = v dd , all other inputs v il = 0.2 v, v ih = v dd ? 0.2 v; no dc loads; less than 50 pf on all outputs; c l = 20 pf on osc2 3. wait i dd measured using external square wave clock source; all i/o pins configured as inputs, port b = v dd , all other inputs v il = 0.2 v, v ih = v dd ? 0.2 v; no dc loads; less than 50 pf on all outputs; c l = 20 pf on osc2. wait i dd is affected linearly by the osc2 capacitance 4. stop i dd measured with osc1 = 0.2 v; all i/o pins configured as inputs, port b = v dd , all other inputs v il = 0.2 v, v ih = v dd ? 0.2 v characteristic symbol min typ max unit input pullup current (v dd = 4.5 ? 5.5 v) pb7 ? pb0 (with pullup) i in 51560 a input pullup current (v dd = 2.4 ? 3.6 v) pb7 ? pb0 (with pullup) i in 1516 a
non-disclosure agreement required mc68hsc05c9a advance information MC68HC05C9A ? rev. 5.0 150 mc68hsc05c9a motorola b.5 control timing the data in 12.8 5.0-volt control timing and 12.9 3.3-volt control timing applies to the mc68hsc05c9a with the exceptions given here. b.5.1 4.5 ? 5.5-volt high-speed control timing characteristic (1) symbol min max unit oscillator frequency crystal external clock f osc ? dc 8.2 8.2 mhz internal operating frequency (f osc 2) crystal external clock f op ? dc 4.1 4.1 mhz cycle time t cyc 244 ? ns crystal oscillator startup time t oxov 100 ms stop recovery startup time t ilch 100 ms reset pulse width t rl 1.5 ? t cyc timer resolution (2) input capture pulse width input capture pulse width t resl t th or t tl t tht l 4.0 64 note (3) ? ? ? t cyc ns t cyc interrupt pulse width low (edge-triggered) t ilih 64 ? ns interrupt pulse period t ilil note (4) ? t cyc osc1 pulse width t oh or t ol 50 ? ns 1. v dd = 4.5 ? 5.5 vdc 2. because a 2-bit prescaler in the timer must count four internal cycles (t cyc ), this is the limiting minimum factor in determining the timer resolution. 3. the minimum period t tltl should not be less than the number of cycle times it takes to execute the capture interrupt service routine plus 24 t cyc . 4. the minimum t ilil should not be less than the number of cycle times it takes to execute the interrupt service routine plus 19 t cyc .
mc68hsc05c9a control timing MC68HC05C9A ? rev. 5.0 advance information motorola mc68hsc05c9a 151 non-disclosure agreement required b.5.2 2.4 ? 3.6-volt high-speed control timing characteristic (1) symbol min max unit oscillator frequency crystal external clock f osc ? dc 4.2 4.2 mhz internal operating frequency (f osc 2) crystal external clock f op ? dc 2.1 2.1 mhz cycle time t cyc 480 ? ns crystal oscillator startup time t oxov ? 100 ms stop recovery startup time t ilch ? 100 ms reset pulse width t rl 1.5 ? t cyc timer resolution (2) input capture pulse width input capture pulse width t resl t th or t tl t thtl 4.0 125 note (3) ? ? ? t cyc ns t cyc interrupt pulse width low (edge-triggered) t ilih 125 ? ns interrupt pulse period t ilil note (4) ? t cyc osc1 pulse width t oh or t ol 90 ? ns 1. v dd = 2.4 ? 3.6 vdc 2. because a 2-bit prescaler in the timer must count four internal cycles (t cyc ), this is the limiting minimum factor in determining the timer resolution. 3. the minimum period t tltl should not be less than the number of cycle times it takes to execute the capture interrupt service routine plus 24 t cyc . 4. the minimum t ilil should not be less than the number of cycle times it takes to execute the interrupt service routine plus 19 t cyc .
non-disclosure agreement required mc68hsc05c9a advance information MC68HC05C9A ? rev. 5.0 152 mc68hsc05c9a motorola b.5.3 4.5 ? 5.5-volt high-speed control timing num characteristic (1) symbol min max unit operating frequency master slave f op(m) f op(s) dc dc 0.5 4.1 f op mhz 1 cycle time master slave t cyc(m) t cyc(s) 2.0 244 ? ? t cyc ns 2 enable lead time master slave t lead(m) t lead(s) note (2) 122 ? ? ns 3 enable lag time master slave t lag(m) t lag(s) note (2) 366 ? ? ns 4 clock (sck) high time master slave t w(sckh)m t w(sckh)s 166 93 ? ? ns 5 clock (sck) low time master slave t w(sckl)m t w(sckl)s 166 93 ? ? ns 6 data setup time (inputs) master slave t su(m) t su(s) 49 49 ? ? ns 7 data hold time (inputs) master slave t h(m) t h(s) 49 49 ? ? ns 8 slave access time (time to data active from high-impedance state) t a 061ns 9 slave disable time (hold time to high-impedance state) t dis ? 122 ns 10 data valid master (before capture edge) slave (after enable edge) (3) t v(m) t v(s) 0.25 ? ? 122 t cyc(m) ns 11 data hold time (outputs) master (after capture edge) slave (after enable edge) t ho(m) t ho(s) 0.25 0 ? ? t cyc(m) ns 12 rise time (20% v dd to 70% v dd , c l = 200 pf) spi outputs (sck, mosi, and miso) spi inputs (sck, mosi, miso, and ss ) t rm t rs ? ? 50 1.0 ns s 13 fall time (70% v dd to 20% v dd , c l = 200 pf) spi outputs (sck, mosi, and miso) spi inputs (sck, mosi, miso, and ss ) t fm t fs ? ? 50 1.0 ns s 1. v dd = 4.5 ? 5.5 vdc 2. signal production depends on software. 3. assumes 200 pf load on all spi pins
mc68hsc05c9a control timing MC68HC05C9A ? rev. 5.0 advance information motorola mc68hsc05c9a 153 non-disclosure agreement required b.5.4 2.4 ? 3.6-volt high-speed spi timing num characteristic (1) symbol min max unit operating frequency master slave f op(m) f op(s) dc dc 0.5 2.1 f op mhz 1 cycle time master slave t cyc(m) t cyc(s) 2.0 480 ? ? t cyc ns 2 enable lead time master slave t lead(m) t lead(s) note (2) 240 ? ? ns 3 enable lag time master slave t lag(m) t lag(s) note (2) 720 ? ? ns 4 clock (sck) high time master slave t w(sckh)m t w(sckh)s 340 190 ? ? ns 5 clock (sck) low time master slave t w(sckl)m t w(sckl)s 340 190 ? ? ns 6 data setup time (inputs) master slave t su(m) t su(s) 100 100 ? ? ns 7 data hold time (inputs) master slave t h(m) t h(s) 100 100 ? ? ns 8 slave access time (time to data active from high-impedance state) t a 0 120 ns 9 slave disable time (hold time to high-impedance state) t dis ? 240 ns 10 data valid master (before capture edge) slave (after enable edge) (3) t v(m) t v(s) 0.25 ? ? 240 t cyc(m) ns 11 data hold time (outputs) master (after capture edge) slave (after enable edge) t ho(m) t ho(s) 0.25 0 ? ? t cyc(m) ns 12 rise time (20% v dd to 70% v dd , c l = 200 pf) spi outputs (sck, mosi, and miso) spi inputs (sck, mosi, miso, and ss ) t rm t rs ? ? 100 2.0 ns s 13 fall time (70% v dd to 20% v dd , c l = 200 pf) spi outputs (sck, mosi, and miso) spi inputs (sck, mosi, miso, and ss ) t fm t fs ? ? 100 2.0 ns s 1. v dd = 2.4 ? 3.6 vdc 2. signal production depends on software. 3. assumes 200 pf load on all spi pins
non-disclosure agreement required mc68hsc05c9a advance information MC68HC05C9A ? rev. 5.0 154 mc68hsc05c9a motorola
MC68HC05C9A ? rev. 5.0 advance information motorola self-check mode 155 non-disclosure agreement required advance information ? MC68HC05C9A appendix c. self-check mode c.1 contents c.2 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .155 c.3 self-check mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .156 c.3.1 self-check tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .156 c.3.2 self-check results. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158 c.2 introduction this appendix describes the self-check mode.
non-disclosure agreement required self-check mode advance information MC68HC05C9A ? rev. 5.0 156 self-check mode motorola c.3 self-check mode self-check mode is entered upon the rising edge of reset if the irq pin is at v tst and the tcap pin is at logic 1. c.3.1 self-check tests the self-check read-only memory (rom) at mask rom location $3f00 ? $3fef determines if the microcontroller unit (mcu) is functioning properly. these tests are performed: 1. input/output (i/o) ? functional test of ports a, b, and c 2. random-access memory (ram) ? counter test for each ram byte 3. timer ? test of counter register and ocf bit 4. serial communications interface (sci) ? transmission test; checks for rdrf, tdre, tc, and fe flags 5. rom ? exclusive or with odd ones parity result 6. serial peripheral interface (spi) ? transmission test; checks for spif and wcol flags the self-check circuit is shown in figure c-1 .
self-check mode self-check mode MC68HC05C9A ? rev. 5.0 advance information motorola self-check mode 157 non-disclosure agreement required figure c-1. self-check circuit schematic 1 2 3 4 5 6 7 8 9 10 11 12 13 14 27 28 29 30 31 32 33 34 35 36 37 38 39 40 15 16 17 18 19 20 21 22 23 24 25 26 v dd 4.7 k ? reset irq pa5 pa4 pa3 pa2 pa1 pa0 pb0 pa6 pb1 pb2 nc pa7 pb3 pb4 pb5 pb6 pb7 v ss 20 pf 10 m ? 4 mhz 20 pf pc0 v dd osc1 osc2 tcap pd7 tcmp pd5/ss pd4/sck pd3/mosi pd2/miso pd1/tdo pd0/rdi pc1 pc2 pc3 pc4 pc5 pc6 pc7 v dd 1 m ? 10 v MC68HC05C9A mc34064 v dd v dd 10k cmos buffer (mc74hc125) 330 ? 330 ? 330 ? 330 ? notes: 1. v dd = 5.0 v 2. tcmp = nc v dd
non-disclosure agreement required self-check mode advance information MC68HC05C9A ? rev. 5.0 158 self-check mode motorola c.3.2 self-check results table c-1 shows the led codes that indicate self-check test results. perform these steps to activate the self-check tests: 1. apply 10 v (2 x v dd ) to the irq pin. 2. apply a logic 1 to the tcap pin. 3. apply a logic 0 to the reset pin. the self-check tests begin on the rising edge of the reset pin. reset must be held low for 4064 cycles after power-on reset (por), or for a time, t rl , for any other reset. for the value of t rl , see 12.8 5.0-volt control timing and 12.9 3.3-volt control timing . table c-1. self-check circuit led codes pc3 pc2 pc1 pc0 remarks offononoffi/o failure off on off on ram failure off on off off timer failure off off on on sci failure off off on off rom failure offoffoffonspi failure flashing no failure all others device failure
MC68HC05C9A ? rev. 5.0 advance information motorola m68hc05cx family feature comparisons 159 non-disclosure agreement required advance information ? MC68HC05C9A appendix d. m68hc05cx family feature comparisons refer to table d-1 for a comparison of the features for all the m68hc05c family members.
non-disclosure agreement required advance information MC68HC05C9A ? rev. 5.0 160 m68hc05cx family feature comparisons motorola m68hc05cx family feature comparisons table d-1. m68hc05cx feature comparison c4 c4a 705c4a c8 c8a 705c8 705c8a c12 c12a c9 c9a 705c9 705c9a user rom 4160 4160 ? 7744 7744 ?? 12,096 12,096 15,760 ? 15,936 15,760 ? 15,936 ?? user eprom ?? 4160 ?? 7596 ? 7740 7596 ? 7740 ?? ? ? 15,760 ? 15,936 12,096 ? 15,936 code security no yes yes no yes yes yes no yes no yes no yes ram 176 176 176 176 176 176 ? 304 176 ? 304 176 176 176 ? 352 176 ? 352 176 ? 352 176 ? 352 option register (irq/ram/ sec) no no $1fdf (irq/sec) no no $1fdf (irq/ram/ sec) $1fdf (irq/ram/sec) no no $3fdf (irq/ram) $3fdf (irq/ram) $3fdf (irq/ram) $3fdf (irq/ram) mask option register(s) no no $1ff0 ? $1ff1 no no no $1ff0 ? $1ff1 no no no no no $3ff0 ? $3ff1 portb keyscan (pullup/ interrupt) no yes mask option yes mor select- able no yes mask option no yes mor selectable yes mask option yes mask option no yes mask option no yes mor selectable pc7 drive standard high current high current standard high current standard high current high current high current standard high current standard high current port d pd7, 5 ? 0 input only pd7, 5 ? 0 input only pd7, 5 ? 0 input only pd7, 5 ? 0 input only pd7, 5 ? 0 input only pd7, 5 ? 0 input only pd7, 5 ? 0 input only pd7, 5 ? 0 input only pd7, 5 ? 0 input only pd7, 5 ? 0 bidirec- tional pd7, 5 ? 0 bidirec- tional pd7, 5 ? 0 bidirec- tional pd7, 5 ? 0 bidirectional cop no yes yes no yes yes two types yes yes yes yes yes two types cop enable ? mask option mor ? mask option software software+ mor mask option mask option software software software software+ mor cop timeout ? 64 ms (@4 mhz osc) 64 ms (@4 mhz osc) ? 64 ms (@4 mhz osc) software selectable software+ mor selectable 64 ms (@4 mhz osc) 64 ms (@4mhz osc) software selectable software selectable software selectable software+ mor selectable cop clear ? clr $1ff0 clr $1ff0 ? clr $1ff0 write $55/$aa to $001d write $55/$aa to $001d or clr $1ff0 clr $3ff0 clr $3ff0 write $55/$aa to $001d write $55/$aa to $001d write $55/$aa to $001d write $55/$aa to $001d or clr $3ff0 clock monitor no no no no no yes yes no no yes yes yes yes (c9a mode) active reset no no no no no cop/clock monitor program- mable cop/clock monitor no no por/cop/ clock monitor por/cop/ clock monitor por/cop/ clock monitor por/c9a cop/ clock monitor stop disable no mask option no no mask option no no mask option mask option no no no mor selectable (c12a mode) notes: 1. the expanded ram map (from $30 ? $4f and $100 ? $15f) available on the otp devices mc68hc705c8 and mc68hc705c8a is not available on the rom devices mc68hc05c8 and mc68hc05c8a. 2. the programmable cop available on the mc68hc705c8 and mc68hc705c8a is not available on the mc68hc05c8a. for rom compatibility , use the non-programmable cop.
blank
MC68HC05C9A/d rev 5 mc 68hc05p6 technical data how to reach us: usa/europe/locations not listed: motorola literature distribution p.o. box 5405 denver, colorado 80217 1-303-675-2140 1-800-441-2447 technical information center: 1-800-521-6274 japan: motorola japan ltd. sps, technical information center 3-20-1, minami-azabu, minato-ku tokyo 106-8573 japan 81-3-3440-3569 asia/pacific: motorola semiconductors h.k. ltd. silicon harbour centre 2 dai king street tai po industrial estate tai po, n.t., hong kong 852-26668334 home page: http://www.motorola.com/semiconductors/ q4/00 rev 1


▲Up To Search▲   

 
Price & Availability of MC68HC05C9A

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X